Class: Falcore::Aggregator
- Inherits:
-
Object
- Object
- Falcore::Aggregator
- Defined in:
- lib/falcore/aggregator.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize(config) ⇒ Aggregator
constructor
A new instance of Aggregator.
- #run ⇒ Object
Constructor Details
#initialize(config) ⇒ Aggregator
Returns a new instance of Aggregator.
26 27 28 |
# File 'lib/falcore/aggregator.rb', line 26 def initialize(config) @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
21 22 23 |
# File 'lib/falcore/aggregator.rb', line 21 def config @config end |
Instance Method Details
#run ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/falcore/aggregator.rb', line 30 def run hash = Fetcher.get("#{config.jenkins.endpoint}/computer/api/json") master = Node::Master.new(hash['computer'][0]) slaves = hash['computer'][1..-1].map do |slave| Node::Slave.new(master, slave) end master end |