Sha256: 2b1aa193d4d096e76389cdb1b20849d0dfa9360e60a6bb1f278872519c38e16d

Contents?: true

Size: 1.02 KB

Versions: 38

Compression:

Stored size: 1.02 KB

Contents

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

module Fog
  module Compute
    class VirtualBox

      class NetworkAdapters < Fog::Collection

        model Fog::Compute::VirtualBox::NetworkAdapter

        attr_accessor :machine

        def all
          requires :machine
          data = []
          raw_machine = machine.instance_variable_get(:@raw)
          connection.system_properties.network_adapter_count.times do |index|
            data << {
              :raw  => raw_machine.get_network_adapter(index)
            }
          end
          load(data)
        end

        def get(network_adapter_slot)
          requires :machine
          raw_machine = machine.instance_variable_get(:@raw)
          network_adapter = raw_machine.get_network_adapter(network_adapter_slot)
          new(:raw => network_adapter)
        end

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

      end

    end
  end
end

Version data entries

38 entries across 38 versions & 13 rubygems

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