Added generic Sequencer Unit to have a statistics diff with a custom key.
This commit is contained in:
parent
5208d3212a
commit
5f3f2e4e45
1 changed files with 33 additions and 0 deletions
|
@ -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
|
Loading…
Reference in a new issue