Class: Fog::XenServer::Compute::Mock
- Inherits:
-
Object
- Object
- Fog::XenServer::Compute::Mock
show all
- Defined in:
- lib/fog/xenserver/compute/mock.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(options = {}) ⇒ Mock
Returns a new instance of Mock.
17
18
19
20
21
22
23
|
# File 'lib/fog/xenserver/compute/mock.rb', line 17
def initialize(options={})
@host = options[:xenserver_pool_master]
@username = options[:xenserver_username]
@password = options[:xenserver_password]
@connection = Fog::XML::Connection.new(@host)
@connection.authenticate(@username, @password)
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object
25
26
27
|
# File 'lib/fog/xenserver/compute/mock.rb', line 25
def method_missing(method_name, *args)
Fog::Mock.not_implemented
end
|
Class Method Details
.data ⇒ Object
5
6
7
8
9
|
# File 'lib/fog/xenserver/compute/mock.rb', line 5
def self.data
@data ||= Hash.new do |hash, key|
hash[key] = {}
end
end
|
.reset_data(keys = data.keys) ⇒ Object
11
12
13
14
15
|
# File 'lib/fog/xenserver/compute/mock.rb', line 11
def self.reset_data(keys=data.keys)
for key in [*keys]
data.delete(key)
end
end
|