Sha256: 77f8f326bf875ac638b39629b2914e400383a109a9d84a79a3847e6c81c43958

Contents?: true

Size: 884 Bytes

Versions: 42

Compression:

Stored size: 884 Bytes

Contents

require 'fog/core/collection'
require 'fog/virtual_box/models/compute/storage_controller'

module Fog
  module Compute
    class VirtualBox

      class StorageControllers < Fog::Collection

        model Fog::Compute::VirtualBox::StorageController

        attr_accessor :machine

        def all
          requires :machine
          data = machine.instance_variable_get(:@raw).storage_controllers.map do |storage_controller|
            {:raw => storage_controller}
          end
          load(data)
        end

        def get(storage_controller_name)
          requires :machine
          all.detect do |storage_controller|
            storage_controller.name == storage_controller_name
          end
        end

        def new(attributes = {})
          requires :machine
          super({ :machine => machine }.merge!(attributes))
        end

      end

    end
  end
end

Version data entries

42 entries across 42 versions & 13 rubygems

Version Path
fog-nirvanix-1.8.2 lib/fog/virtual_box/models/compute/storage_controllers.rb
fog-nirvanix-1.8.1 lib/fog/virtual_box/models/compute/storage_controllers.rb
fog-parser-fix-1.6.1 lib/fog/virtual_box/models/compute/storage_controllers.rb
fog-test-again-1.6.0 lib/fog/virtual_box/models/compute/storage_controllers.rb
fog-parser-fix-1.6.0 lib/fog/virtual_box/models/compute/storage_controllers.rb
fog-1.9.0 lib/fog/virtual_box/models/compute/storage_controllers.rb
fog-maestrodev-1.8.0.20130114204828 lib/fog/virtual_box/models/compute/storage_controllers.rb
fog-maestrodev-1.8.0.20130111070250 lib/fog/virtual_box/models/compute/storage_controllers.rb
fog-maestrodev-1.8.0.20130109172219 lib/fog/virtual_box/models/compute/storage_controllers.rb
ey-vendored-backup-3.0.27 vendor/gems/fog/lib/fog/virtual_box/models/compute/storage_controllers.rb
fog-sgonyea-1.8.1 lib/fog/virtual_box/models/compute/storage_controllers.rb
fog-1.8.0 lib/fog/virtual_box/models/compute/storage_controllers.rb
fog-maestrodev-1.7.0.20121114190951 lib/fog/virtual_box/models/compute/storage_controllers.rb
fog-1.7.0 lib/fog/virtual_box/models/compute/storage_controllers.rb
fog-1.6.0 lib/fog/virtual_box/models/compute/storage_controllers.rb
fog-1.5.0 lib/fog/virtual_box/models/compute/storage_controllers.rb
fog-1.4.0 lib/fog/virtual_box/models/compute/storage_controllers.rb
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/lib/fog/virtual_box/models/compute/storage_controllers.rb
michiels-fog-1.3.1 lib/fog/virtual_box/models/compute/storage_controllers.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/lib/fog/virtual_box/models/compute/storage_controllers.rb