Added generic Sequencer Unit to have a statistics diff with a custom key.

This commit is contained in:
Thorsten Eckel 2018-01-16 09:15:51 +01:00
parent 5208d3212a
commit 5f3f2e4e45

View file

@ -0,0 +1,33 @@
require 'sequencer/unit/import/common/model/statistics/mixin/action_diff'
class Sequencer
class Unit
module Import
module Common
module Model
module Statistics
module Diff
class CustomKey < Sequencer::Unit::Base
include ::Sequencer::Unit::Import::Common::Model::Statistics::Mixin::ActionDiff
def process
state.provide(:statistics_diff) do
{
key => diff,
}
end
end
private
def key
raise "Missing implementation of method 'key' for class #{self.class.name}"
end
end
end
end
end
end
end
end
end