Class: Alephant::Broker::Request::Batch

Inherits:
Object
  • Object
show all
Includes:
Logger
Defined in:
lib/alephant/broker/request/batch.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(component_factory, env) ⇒ Batch

Returns a new instance of Batch.



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/alephant/broker/request/batch.rb', line 12

def initialize(component_factory, env)
  @batch_id = if env.data
                env.data["batch_id"]
              else
                env.options.fetch("batch_id", nil)
              end

  logger.info "Request::Batch#initialize: id: #{batch_id}"

  @component_factory = component_factory

  @components        = env.post? ? components_post(env) : components_get(env)
end

Instance Attribute Details

#batch_idObject (readonly)

Returns the value of attribute batch_id.



10
11
12
# File 'lib/alephant/broker/request/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/request/batch.rb', line 10

def components
  @components
end

#load_strategyObject (readonly)

Returns the value of attribute load_strategy.



10
11
12
# File 'lib/alephant/broker/request/batch.rb', line 10

def load_strategy
  @load_strategy
end