Class: RemoteExecutor::Systems

Inherits:
Object
  • Object
show all
Defined in:
lib/remote_executor/systems.rb

Overview

A collection of System

Instance Method Summary collapse

Constructor Details

#initialize(system_file) ⇒ Systems

Returns a new instance of Systems.



30
31
32
33
34
35
36
37
# File 'lib/remote_executor/systems.rb', line 30

def initialize( system_file )

  @systems = YAML::load_file( system_file )
rescue Exception => e
  raise SystemsFileError.new( e.message )
else
  self
end

Instance Method Details

#find_by_name(name) ⇒ Object

Raises:



20
21
22
23
24
25
26
27
28
# File 'lib/remote_executor/systems.rb', line 20

def find_by_name( name )
  
  @systems.each do |entry|
    
    return SystemFactory.create( entry ) if( name == entry[:name] ) 
  end
  
  raise SystemNotFound.new( "System: '#{name}' not found" )
end