Module: Fog::Softlayer::Compute::Shared

Overview

The Shared module consists of code that was duplicated between the Real and Mock implementations.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.valid_request?(required, passed) ⇒ Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/fog/softlayer/compute/shared.rb', line 33

def self.valid_request?(required, passed)
  required.all? {|k| passed.key?(k)}
end

Instance Method Details

#initialize(options) ⇒ Object

Creates a new instance of the Softlayer Compute service

Parameters:

Options Hash (options):

  • :softlayer_api_url (String)

    Override the default (or configured) API endpoint

  • :softlayer_username (String)

    Email or user identifier for user based authentication

  • :softlayer_api_key (String)

    Password for user based authentication



27
28
29
30
31
# File 'lib/fog/softlayer/compute/shared.rb', line 27

def initialize(options)
  @api_url             = options[:softlayer_api_url] || SL_API_URL
  @credentials   = { :username => options[:softlayer_username], :api_key => options[:softlayer_api_key] }
  @default_domain = options[:softlayer_default_domain]
end