fog/fog-xenserver

View on GitHub
lib/fog/xenserver/compute/mock.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Fog
  module XenServer
    class Compute
      class Mock
        def self.data
          @data ||= Hash.new do |hash, key|
            hash[key] = {}
          end
        end

        def self.reset_data(keys=data.keys)
          for key in [*keys]
            data.delete(key)
          end
        end

        def initialize(options={})
          @host        = options[:xenserver_pool_master]
          @username    = options[:xenserver_username]
          @password    = options[:xenserver_password]
          @connection  = Fog::XML::Connection.new(@host)
          @connection.authenticate(@username, @password)
        end

        def method_missing(method_name, *args)
          Fog::Mock.not_implemented
        end
      end
    end
  end
end