Class: Alephant::Broker::ComponentMeta

Inherits:
Object
  • Object
show all
Defined in:
lib/alephant/broker/component_meta.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, batch_id, options) ⇒ ComponentMeta

Returns a new instance of ComponentMeta.



6
7
8
9
10
# File 'lib/alephant/broker/component_meta.rb', line 6

def initialize(id, batch_id, options)
  @id          = id
  @batch_id    = batch_id
  @options     = convert_keys(options || {})
end

Instance Attribute Details

#batch_idObject (readonly)

Returns the value of attribute batch_id.



4
5
6
# File 'lib/alephant/broker/component_meta.rb', line 4

def batch_id
  @batch_id
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/alephant/broker/component_meta.rb', line 4

def id
  @id
end

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/alephant/broker/component_meta.rb', line 4

def options
  @options
end

Instance Method Details

#component_keyObject

NOTE: This is in use in ‘alephant-publisher-queue` also, so if you

change this, you'll need to change this there also.


22
23
24
# File 'lib/alephant/broker/component_meta.rb', line 22

def component_key
  "#{id}/#{opts_hash}"
end

#keyObject



12
13
14
# File 'lib/alephant/broker/component_meta.rb', line 12

def key
  batch_id.nil? ? component_key : renderer_key
end

#opts_hashObject



16
17
18
# File 'lib/alephant/broker/component_meta.rb', line 16

def opts_hash
  Crimp.signature options
end