Sha256: 8e3079950cb7c0476463f1526739656b5a0c9eaeb01cae1d744b1c9695200a9a

Contents?: true

Size: 1.11 KB

Versions: 3

Compression:

Stored size: 1.11 KB

Contents

require 'net/http'
require 'net/https'
require 'cgi'
require 'rubygems'
require 'xmlsimple'

module Solusvm
  class << self
    attr_accessor :api_endpoint, :api_id, :api_key, :api_options

    # Specifies the login and url for making requests
    #
    # example:
    #
    #   Solusvm.config('id', 'key', :url => 'http://www.example.com/api', :logger => RAILS_LOGGER, :logger_method => :log_info)
    #
    # Options:
    # * <tt>:logger</tt> - Log object used for logging API responses
    # * <tt>:logger_method</tt> - The method that performs the logging on the Log object
    def config(api_id, api_key, options={})
      @api_id       = api_id
      @api_key      = api_key
      @api_endpoint = URI.parse(options.delete(:url))
      @api_options  = options
    end
  end
end

directory = File.expand_path(File.dirname(__FILE__))

require File.join(directory, 'solusvm', 'exceptions')
require File.join(directory, 'solusvm', 'hash')
require File.join(directory, 'solusvm', 'base')
require File.join(directory, 'solusvm', 'general')
require File.join(directory, 'solusvm', 'client')
require File.join(directory, 'solusvm', 'server')

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
solusvm-0.10.1 lib/solusvm.rb
solusvm-0.10.0 lib/solusvm.rb
solusvm-0.9.0 lib/solusvm.rb