Class: RemoteExecutor::Systems
- Inherits:
-
Object
- Object
- RemoteExecutor::Systems
- Defined in:
- lib/remote_executor/systems.rb
Overview
A collection of System
Instance Method Summary collapse
- #find_by_name(name) ⇒ Object
-
#initialize(system_file) ⇒ Systems
constructor
A new instance of Systems.
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. ) else self end |
Instance Method Details
#find_by_name(name) ⇒ Object
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 |