Class: Alephant::Publisher::WriteOperation
- Inherits:
-
Object
- Object
- Alephant::Publisher::WriteOperation
- Defined in:
- lib/alephant/publisher/write_operation.rb
Instance Attribute Summary collapse
-
#batch_sequencer ⇒ Object
readonly
Returns the value of attribute batch_sequencer.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#msg ⇒ Object
readonly
Returns the value of attribute msg.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#options_hash ⇒ Object
readonly
Returns the value of attribute options_hash.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(msg, opts) ⇒ WriteOperation
constructor
A new instance of WriteOperation.
- #sequencer_for(id, options) ⇒ Object
Constructor Details
#initialize(msg, opts) ⇒ WriteOperation
Returns a new instance of WriteOperation.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/alephant/publisher/write_operation.rb', line 11 def initialize(msg, opts) @msg = msg @data = Support::Parser.new(opts[:msg_vary_path]).parse(msg) = @data[:options] = Crimp.signature() @renderer_id = opts[:renderer_id] @sequencer_opts = opts[:sequencer_opts] @batch_sequencer = sequencer_for(@renderer_id, ) @version = @batch_sequencer.sequence_id_from(msg) end |
Instance Attribute Details
#batch_sequencer ⇒ Object (readonly)
Returns the value of attribute batch_sequencer.
9 10 11 |
# File 'lib/alephant/publisher/write_operation.rb', line 9 def batch_sequencer @batch_sequencer end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
9 10 11 |
# File 'lib/alephant/publisher/write_operation.rb', line 9 def data @data end |
#msg ⇒ Object (readonly)
Returns the value of attribute msg.
9 10 11 |
# File 'lib/alephant/publisher/write_operation.rb', line 9 def msg @msg end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
9 10 11 |
# File 'lib/alephant/publisher/write_operation.rb', line 9 def end |
#options_hash ⇒ Object (readonly)
Returns the value of attribute options_hash.
9 10 11 |
# File 'lib/alephant/publisher/write_operation.rb', line 9 def end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
9 10 11 |
# File 'lib/alephant/publisher/write_operation.rb', line 9 def version @version end |
Instance Method Details
#sequencer_for(id, options) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/alephant/publisher/write_operation.rb', line 22 def sequencer_for(id, ) Sequencer.create( @sequencer_opts[:table_name], sequencer_id_from(id, ), @sequencer_opts[:id_path] ) end |