Class: Fog::SSH::Mock
- Inherits:
-
Object
- Object
- Fog::SSH::Mock
- Defined in:
- lib/rackspace-fog/core/ssh.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(address, username, options) ⇒ Mock
constructor
A new instance of Mock.
- #run(commands, &blk) ⇒ Object
Constructor Details
#initialize(address, username, options) ⇒ Mock
Returns a new instance of Mock.
26 27 28 29 30 |
# File 'lib/rackspace-fog/core/ssh.rb', line 26 def initialize(address, username, ) @address = address @username = username @options = end |
Class Method Details
.data ⇒ Object
16 17 18 19 20 |
# File 'lib/rackspace-fog/core/ssh.rb', line 16 def self.data @data ||= Hash.new do |hash, key| hash[key] = [] end end |
.reset ⇒ Object
22 23 24 |
# File 'lib/rackspace-fog/core/ssh.rb', line 22 def self.reset @data= nil end |
Instance Method Details
#run(commands, &blk) ⇒ Object
32 33 34 |
# File 'lib/rackspace-fog/core/ssh.rb', line 32 def run(commands, &blk) self.class.data[@address] << {:commands => commands, :username => @username, :options => @options} end |