Class: Fog::SSH::Mock

Inherits:
Object
  • Object
show all
Defined in:
lib/fog/core/ssh.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(address, username, options) ⇒ Mock

Returns a new instance of Mock.



26
27
28
29
30
# File 'lib/fog/core/ssh.rb', line 26

def initialize(address, username, options)
  @address  = address
  @username = username
  @options  = options
end

Class Method Details

.dataObject



16
17
18
19
20
# File 'lib/fog/core/ssh.rb', line 16

def self.data
  @data ||= Hash.new do |hash, key|
    hash[key] = []
  end
end

.resetObject



22
23
24
# File 'lib/fog/core/ssh.rb', line 22

def self.reset
  @data= nil
end

Instance Method Details

#run(commands, &blk) ⇒ Object



32
33
34
# File 'lib/fog/core/ssh.rb', line 32

def run(commands, &blk)
  self.class.data[@address] << {:commands => commands, :username => @username, :options => @options}
end