Class: Alephant::Publisher::Queue::Writer
- Inherits:
-
Object
- Object
- Alephant::Publisher::Queue::Writer
- Includes:
- Logger
- Defined in:
- lib/alephant/publisher/queue/writer.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#parser ⇒ Object
readonly
Returns the value of attribute parser.
-
#storage ⇒ Object
readonly
Returns the value of attribute storage.
Instance Method Summary collapse
-
#initialize(config, message) ⇒ Writer
constructor
A new instance of Writer.
- #renderer ⇒ Object
- #run! ⇒ Object
Constructor Details
#initialize(config, message) ⇒ Writer
Returns a new instance of Writer.
18 19 20 21 |
# File 'lib/alephant/publisher/queue/writer.rb', line 18 def initialize(config, ) @config = config @message = end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
16 17 18 |
# File 'lib/alephant/publisher/queue/writer.rb', line 16 def config @config end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
16 17 18 |
# File 'lib/alephant/publisher/queue/writer.rb', line 16 def @message end |
#parser ⇒ Object (readonly)
Returns the value of attribute parser.
16 17 18 |
# File 'lib/alephant/publisher/queue/writer.rb', line 16 def parser @parser end |
#storage ⇒ Object (readonly)
Returns the value of attribute storage.
16 17 18 |
# File 'lib/alephant/publisher/queue/writer.rb', line 16 def storage @storage end |
Instance Method Details
#renderer ⇒ Object
23 24 25 |
# File 'lib/alephant/publisher/queue/writer.rb', line 23 def renderer @renderer ||= Alephant::Renderer.create(config, data) end |
#run! ⇒ Object
40 41 42 43 44 45 46 47 |
# File 'lib/alephant/publisher/queue/writer.rb', line 40 def run! if component_records_write_successful? seq_for(config[:renderer_id]).validate() do # block needed in sequencer. Need to make optional with `block.given?` # https://github.com/BBC-News/alephant-sequencer/blob/master/lib/alephant/sequencer/sequencer.rb#L41 end end end |