Class: Alephant::Broker::Request::Asset

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(component_factory, env = nil) ⇒ Asset

Returns a new instance of Asset.



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

def initialize(component_factory, env = nil)
  return if env.nil?
  @component = component_factory.create(
    component_id(env.path),
    nil,
    env.options
  )
rescue InvalidAssetId
  logger.metric "InvalidAssetId"
  logger.error(
    method: 'Broker.Request.Asset.initialize',
    message: 'Exception raised (InvalidAssetId)'
  )
end

Instance Attribute Details

#componentObject

Returns the value of attribute component.



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

def component
  @component
end