Sha256: 0618e973eb6aeda29af52fd713d2f2c57a02e5e74ec4a198cb80dd1b7bead64f

Contents?: true

Size: 1.18 KB

Versions: 13

Compression:

Stored size: 1.18 KB

Contents

require 'fog/virtual_box'
require 'fog/compute'

module Fog
  module Compute
    class VirtualBox < Fog::Service

      model_path 'fog/virtual_box/models/compute'
      model       :medium
      collection  :mediums
      model       :medium_format
      model       :nat_engine
      model       :nat_redirect
      collection  :nat_redirects
      model       :network_adapter
      collection  :network_adapters
      model       :server
      collection  :servers
      model       :storage_controller
      collection  :storage_controllers

      class Mock

        def initialize(options={})
          Fog::Mock.not_implemented
        end

      end

      class Real

        def initialize(options={})
          require 'virtualbox'
          @connection = ::VirtualBox::Global.global.lib.virtualbox
        end

        def respond_to?(method, *)
          super or @connection.respond_to? method
        end

        # hack to provide 'requests'
        def method_missing(method_sym, *arguments, &block)
          if @connection.respond_to?(method_sym)
            @connection.send(method_sym, *arguments)
          else
            super
          end
        end

      end
    end
  end
end

Version data entries

13 entries across 13 versions & 7 rubygems

Version Path
fog-nirvanix-1.8.2 lib/fog/virtual_box/compute.rb
fog-nirvanix-1.8.1 lib/fog/virtual_box/compute.rb
fog-parser-fix-1.6.1 lib/fog/virtual_box/compute.rb
fog-test-again-1.6.0 lib/fog/virtual_box/compute.rb
fog-parser-fix-1.6.0 lib/fog/virtual_box/compute.rb
ey-vendored-backup-3.0.27 vendor/gems/fog/lib/fog/virtual_box/compute.rb
fog-sgonyea-1.8.1 lib/fog/virtual_box/compute.rb
fog-1.8.0 lib/fog/virtual_box/compute.rb
fog-maestrodev-1.7.0.20121114190951 lib/fog/virtual_box/compute.rb
fog-1.7.0 lib/fog/virtual_box/compute.rb
fog-1.6.0 lib/fog/virtual_box/compute.rb
fog-1.5.0 lib/fog/virtual_box/compute.rb
fog-1.4.0 lib/fog/virtual_box/compute.rb