Class: TTK::Strategies::RemoteCmd::HostDispatcher

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/ttk/strategies/RemoteCmd.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHostDispatcher

Returns a new instance of HostDispatcher.



21
22
23
# File 'lib/ttk/strategies/RemoteCmd.rb', line 21

def initialize
  @hosts = []
end

Instance Attribute Details

#hostsObject

Returns the value of attribute hosts.



19
20
21
# File 'lib/ttk/strategies/RemoteCmd.rb', line 19

def hosts
  @hosts
end

Instance Method Details

#<<(aConf) ⇒ Object



25
26
27
28
29
30
# File 'lib/ttk/strategies/RemoteCmd.rb', line 25

def << ( aConf )
  unless aConf.is_a? Hash
    raise ArgumentError, "not a valid conf: `#{aConf}:#{aConf.class}'"
  end
  @hosts << aConf
end

#aConfObject



37
38
39
40
41
# File 'lib/ttk/strategies/RemoteCmd.rb', line 37

def aConf
  aConf = hosts.shift
  hosts.push aConf
  aConf
end