Class: Fog::Hetznercloud::Compute::Locations

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/hetznercloud/models/compute/locations.rb

Instance Method Summary collapse

Instance Method Details

#all(filters = {}) ⇒ Object



7
8
9
10
# File 'lib/fog/hetznercloud/models/compute/locations.rb', line 7

def all(filters = {})
  locations = service.list_locations(filters).body['locations'] || []
  load(locations)
end

#get(identity) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/fog/hetznercloud/models/compute/locations.rb', line 12

def get(identity)
  if (location = service.get_location(identity).body['location'])
    new(location)
  end
rescue Fog::Hetznercloud::Compute::UnknownResourceError
  nil
end