Class: GitCompound::Worker::ComponentsCollector
- Defined in:
- lib/git_compound/worker/components_collector.rb
Overview
Worker thas collects are encountered components
Instance Attribute Summary collapse
-
#components ⇒ Object
readonly
Returns the value of attribute components.
Instance Method Summary collapse
-
#initialize(collection) ⇒ ComponentsCollector
constructor
A new instance of ComponentsCollector.
- #visit_component(component) ⇒ Object
Methods inherited from Worker
Constructor Details
#initialize(collection) ⇒ ComponentsCollector
Returns a new instance of ComponentsCollector.
8 9 10 11 12 13 |
# File 'lib/git_compound/worker/components_collector.rb', line 8 def initialize(collection) raise GitCompoundError, 'Collection should be a Hash' unless collection.is_a? Hash @components = collection end |
Instance Attribute Details
#components ⇒ Object (readonly)
Returns the value of attribute components.
6 7 8 |
# File 'lib/git_compound/worker/components_collector.rb', line 6 def components @components end |
Instance Method Details
#visit_component(component) ⇒ Object
15 16 17 |
# File 'lib/git_compound/worker/components_collector.rb', line 15 def visit_component(component) @components.store(component.name, component) end |