Class: Alephant::Broker::Response::Batch
- Includes:
- Logger
- Defined in:
- lib/alephant/broker/response/batch.rb
Constant Summary
Constants inherited from Base
Alephant::Broker::Response::Base::STATUS_CODE_MAPPING
Instance Attribute Summary collapse
-
#batch_id ⇒ Object
readonly
Returns the value of attribute batch_id.
-
#components ⇒ Object
readonly
Returns the value of attribute components.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(components, batch_id) ⇒ Batch
constructor
A new instance of Batch.
- #setup ⇒ Object
Constructor Details
#initialize(components, batch_id) ⇒ Batch
Returns a new instance of Batch.
11 12 13 14 15 16 |
# File 'lib/alephant/broker/response/batch.rb', line 11 def initialize(components, batch_id) @components = components @batch_id = batch_id super(200, 'application/json') end |
Instance Attribute Details
#batch_id ⇒ Object (readonly)
Returns the value of attribute batch_id.
9 10 11 |
# File 'lib/alephant/broker/response/batch.rb', line 9 def batch_id @batch_id end |
#components ⇒ Object (readonly)
Returns the value of attribute components.
9 10 11 |
# File 'lib/alephant/broker/response/batch.rb', line 9 def components @components end |
Instance Method Details
#setup ⇒ Object
18 19 20 21 22 23 |
# File 'lib/alephant/broker/response/batch.rb', line 18 def setup @content = ::JSON.generate({ 'batch_id' => batch_id, 'components' => json }) end |