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/google/models/compute/disks.rb
Romain Vrignaud ac8f123900 [google|compute] disks.all shouldn't return nil
* disk.all should return empty Fog::Compute::Google::Disks
2013-08-05 11:10:45 +02:00

28 lines
517 B
Ruby

require 'fog/core/collection'
require 'fog/google/models/compute/disk'
module Fog
module Compute
class Google
class Disks < Fog::Collection
model Fog::Compute::Google::Disk
def all(zone)
data = service.list_disks(zone).body["items"] || []
load(data)
end
def get(identity, zone)
data = service.get_disk(identity, zone).body
new(data)
rescue Excon::Errors::NotFound
nil
end
end
end
end
end