Module: Fog::Ecloud

Extended by:
Provider
Defined in:
lib/fog/ecloud/core.rb,
lib/fog/ecloud/model.rb,
lib/fog/ecloud/collection.rb,
lib/fog/ecloud/mock_data_classes.rb

Defined Under Namespace

Modules: MockDataClasses Classes: Collection, Model

Constant Summary collapse

ECLOUD_OPTIONS =
[:ecloud_authentication_method]

Class Method Summary collapse

Methods included from Provider

[], extended, service, services

Class Method Details

.ip_addressObject



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

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

.keep(hash, *keys) ⇒ Object



11
12
13
14
15
# File 'lib/fog/ecloud/core.rb', line 11

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

.mac_addressObject



27
28
29
# File 'lib/fog/ecloud/core.rb', line 27

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

.slice(hash, *keys) ⇒ Object



17
18
19
20
21
# File 'lib/fog/ecloud/core.rb', line 17

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