Module: Fog::Ecloud

Extended by:
Provider
Defined in:
lib/fog/ecloud.rb,
lib/fog/ecloud/version.rb,
lib/fog/compute/ecloud/errors.rb,
lib/fog/ecloud/mock_data_classes.rb,
lib/fog/compute/ecloud/models/model.rb,
lib/fog/compute/ecloud/models/collection.rb

Defined Under Namespace

Modules: Errors, MockDataClasses Classes: Collection, Model

Constant Summary collapse

ECLOUD_OPTIONS =
[:ecloud_authentication_method]
VERSION =
"0.3.0"

Class Method Summary collapse

Class Method Details

.ip_addressObject



34
35
36
# File 'lib/fog/ecloud.rb', line 34

def self.ip_address
  4.times.map { Fog::Mock.random_numbers(3) }.join(".")
end

.keep(hash, *keys) ⇒ Object



22
23
24
25
26
# File 'lib/fog/ecloud.rb', line 22

def self.keep(hash, *keys)
  {}.tap do |kept|
    keys.each{ |k| kept[k] = hash[k] if hash.key?(k) }
  end
end

.mac_addressObject



38
39
40
# File 'lib/fog/ecloud.rb', line 38

def self.mac_address
  6.times.map { Fog::Mock.random_numbers(2) }.join(":")
end

.slice(hash, *keys) ⇒ Object



28
29
30
31
32
# File 'lib/fog/ecloud.rb', line 28

def self.slice(hash, *keys)
  hash.dup.tap do |sliced|
    keys.each{ |k| sliced.delete(k) }
  end
end