Class: Alephant::Broker::Component
- Inherits:
-
Object
- Object
- Alephant::Broker::Component
- Includes:
- Logger
- Defined in:
- lib/alephant/broker/component.rb
Instance Attribute Summary collapse
-
#batch_id ⇒ Object
readonly
Returns the value of attribute batch_id.
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(id, batch_id, options) ⇒ Component
constructor
A new instance of Component.
- #load ⇒ Object
- #opts_hash ⇒ Object
- #version ⇒ Object
Constructor Details
Instance Attribute Details
#batch_id ⇒ Object (readonly)
Returns the value of attribute batch_id.
15 16 17 |
# File 'lib/alephant/broker/component.rb', line 15 def batch_id @batch_id end |
#content ⇒ Object (readonly)
Returns the value of attribute content.
15 16 17 |
# File 'lib/alephant/broker/component.rb', line 15 def content @content end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
15 16 17 |
# File 'lib/alephant/broker/component.rb', line 15 def id @id end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
15 16 17 |
# File 'lib/alephant/broker/component.rb', line 15 def @options end |
Instance Method Details
#load ⇒ Object
24 25 26 27 28 |
# File 'lib/alephant/broker/component.rb', line 24 def load @content ||= @cache.get(cache_key) do s3.get(s3_path) end end |
#opts_hash ⇒ Object
30 31 32 |
# File 'lib/alephant/broker/component.rb', line 30 def opts_hash @opts_hash ||= Crimp.signature() end |
#version ⇒ Object
34 35 36 |
# File 'lib/alephant/broker/component.rb', line 34 def version @version ||= sequencer.get_last_seen end |