Class: Fog::Compute::ProfitBricks::Locations

Inherits:
Fog::Collection
  • Object
show all
Includes:
Helpers::ProfitBricks::DataHelper
Defined in:
lib/fog/profitbricks/models/compute/locations.rb

Instance Method Summary collapse

Methods included from Helpers::ProfitBricks::DataHelper

#flatten

Instance Method Details

#allObject


11
12
13
14
15
# File 'lib/fog/profitbricks/models/compute/locations.rb', line 11

def all
  result = service.get_all_locations

  load(result.body['items'].each { |location| flatten(location) })
end

#get(id) ⇒ Object


17
18
19
20
21
# File 'lib/fog/profitbricks/models/compute/locations.rb', line 17

def get(id)
  location = service.get_location(id).body

  new(flatten(location))
end