Class: RemoteExecutor::System

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

Overview

System represents a set of hosts that implement a service

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parameters) ⇒ System

Returns a new instance of System.



17
18
19
20
21
22
23
24
25
# File 'lib/remote_executor/system.rb', line 17

def initialize( parameters )
  
  System.validate_parameters( parameters )
  
  @name        = parameters[:name]
  @environment = parameters[:environment]
  @user        = parameters[:user]
  @hosts       = parameters[:hosts]      
end

Instance Attribute Details

#environmentObject (readonly)

Returns the value of attribute environment.



7
8
9
# File 'lib/remote_executor/system.rb', line 7

def environment
  @environment
end

#hostsObject (readonly)

Returns the value of attribute hosts.



7
8
9
# File 'lib/remote_executor/system.rb', line 7

def hosts
  @hosts
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/remote_executor/system.rb', line 7

def name
  @name
end

#userObject (readonly)

Returns the value of attribute user.



7
8
9
# File 'lib/remote_executor/system.rb', line 7

def user
  @user
end

Instance Method Details

#to_sObject



27
28
29
# File 'lib/remote_executor/system.rb', line 27

def to_s
  "#{@user}\@#{@name}.#{@environment}: #{@hosts.inspect}"
end