Class: Alephant::Broker::Response::Batch

Inherits:
Base
  • Object
show all
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

Attributes inherited from Base

#content, #content_type, #status

Instance Method Summary collapse

Constructor Details

#initialize(components, batch_id) ⇒ Batch



12
13
14
15
16
17
# File 'lib/alephant/broker/response/batch.rb', line 12

def initialize(components, batch_id)
  @components = components
  @batch_id   = batch_id

  super(200, 'application/json')
end

Instance Attribute Details

#batch_idObject (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

#componentsObject (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

#setupObject



19
20
21
22
23
24
# File 'lib/alephant/broker/response/batch.rb', line 19

def setup
  @content = JSON.generate({
    "batch_id" => batch_id,
    "components" => json
  })
end