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
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/lib/fog/virtual_box/models/compute/storage_controllers.rb
fog-1.3.1 lib/fog/virtual_box/models/compute/storage_controllers.rb
fog-1.3.0 lib/fog/virtual_box/models/compute/storage_controllers.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/lib/fog/virtual_box/models/compute/storage_controllers.rb
fog-1.2.0 lib/fog/virtual_box/models/compute/storage_controllers.rb
ktheory-fog-1.1.2 lib/fog/virtual_box/models/compute/storage_controllers.rb
brightbox-cli-0.17.4 lib/brightbox-cli/vendor/fog/lib/fog/virtual_box/models/compute/storage_controllers.rb
brightbox-cli-0.17.3 lib/brightbox-cli/vendor/fog/lib/fog/virtual_box/models/compute/storage_controllers.rb
brightbox-cli-0.17.2 lib/brightbox-cli/vendor/fog/lib/fog/virtual_box/models/compute/storage_controllers.rb
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/lib/fog/virtual_box/models/compute/storage_controllers.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/lib/fog/virtual_box/models/compute/storage_controllers.rb
fog-1.1.2 lib/fog/virtual_box/models/compute/storage_controllers.rb
fog_tractical-1.1.4 lib/fog/virtual_box/models/compute/storage_controllers.rb
fog_tractical-1.1.3 lib/fog/virtual_box/models/compute/storage_controllers.rb
brightbox-cli-0.16.0 lib/brightbox-cli/vendor/fog/lib/fog/virtual_box/models/compute/storage_controllers.rb
fog-1.1.1 lib/fog/virtual_box/models/compute/storage_controllers.rb
fog-1.1.0 lib/fog/virtual_box/models/compute/storage_controllers.rb
brightbox-cli-0.15.0 lib/brightbox-cli/vendor/fog/lib/fog/virtual_box/models/compute/storage_controllers.rb
tag-fog-1.0.1 lib/fog/virtual_box/models/compute/storage_controllers.rb
brightbox-cli-0.14.1 lib/brightbox-cli/vendor/fog/lib/fog/virtual_box/models/compute/storage_controllers.rb