1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/bluebox/models/compute/locations.rb

29 lines
522 B
Ruby
Raw Normal View History

2012-02-12 00:02:52 -08:00
require 'fog/core/collection'
require 'fog/bluebox/models/compute/location'
module Fog
module Compute
class Bluebox
class Locations < Fog::Collection
model Fog::Compute::Bluebox::Location
def all
2012-12-22 23:29:33 +00:00
data = service.get_locations.body
2012-02-12 00:02:52 -08:00
load(data)
end
def get(location_id)
2012-12-22 23:29:33 +00:00
response = service.get_location(location_id)
2012-02-12 00:02:52 -08:00
new(response.body)
rescue Fog::Compute::Bluebox::NotFound
nil
end
end
end
end
end