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/compute/models/virtual_box/mediums.rb

32 lines
665 B
Ruby

require 'fog/core/collection'
require 'fog/compute/models/virtual_box/medium'
module Fog
module Compute
class VirtualBox
class Mediums < Fog::Collection
model Fog::Compute::VirtualBox::Medium
def all
data = []
data.concat(connection.dvd_images)
data.concat(connection.floppy_images)
data.concat(connection.hard_disks)
data = data.map do |medium|
{:raw => medium}
end
load(data)
end
def get(medium_identity)
data = connection.find_medium(medium_identity)
new(:raw => data)
end
end
end
end
end