Class: GitCompound::Worker::ComponentsCollector

Inherits:
Worker
  • Object
show all
Defined in:
lib/git_compound/worker/components_collector.rb

Overview

Worker thas collects are encountered components

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Worker

#visit_manifest, #visit_task

Constructor Details

#initialize(collection) ⇒ ComponentsCollector

Returns a new instance of ComponentsCollector.

Raises:



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

#componentsObject (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