Sha256: 490ebf2581cc08200876a2441bd095afc3c2f133e75176579e90f2b42b4d2498
Contents?: true
Size: 772 Bytes
Versions: 18
Compression:
Stored size: 772 Bytes
Contents
require 'alephant/logger' require 'alephant/broker/errors/invalid_asset_id' module Alephant module Broker module Request class Asset include Logger attr_accessor :component 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 "Broker.Request.Asset.initialize: Exception raised (InvalidAssetId)" end private def component_id(path) path.split('/')[2] || (raise InvalidAssetId.new 'No Asset ID specified') end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems