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, request_env) ⇒ Batch
constructor
A new instance of Batch.
- #setup ⇒ Object
Constructor Details
#initialize(components, batch_id, request_env) ⇒ Batch
Returns a new instance of Batch.
12 13 14 15 16 17 18 19 20 |
# File 'lib/alephant/broker/response/batch.rb', line 12 def initialize(components, batch_id, request_env) @components = components @batch_id = batch_id @status = self.class.component_not_modified(batch_response_headers, request_env) ? 304 : 200 super(@status, "application/json", request_env) @headers.merge!(batch_response_headers) end |
Instance Attribute Details
#batch_id ⇒ Object (readonly)
Returns the value of attribute batch_id.
10 11 12 |
# File 'lib/alephant/broker/response/batch.rb', line 10 def batch_id @batch_id end |
#components ⇒ Object (readonly)
Returns the value of attribute components.
10 11 12 |
# File 'lib/alephant/broker/response/batch.rb', line 10 def components @components end |
Instance Method Details
#setup ⇒ Object
22 23 24 25 |
# File 'lib/alephant/broker/response/batch.rb', line 22 def setup @content = ::JSON.generate("batch_id" => batch_id, "components" => json) end |