Sha256: ed463aa31210377702c4854c7528b12816c05fbe4c63889295137e15b1e1580b

Contents?: true

Size: 1.21 KB

Versions: 60

Compression:

Stored size: 1.21 KB

Contents

#
# Author:: Matt Eldridge (<matt.eldridge@us.ibm.com>)
# © Copyright IBM Corporation 2014.
#
# LICENSE: MIT (http://opensource.org/licenses/MIT)
#

module Fog
  module Softlayer
    module Compute

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

        # Creates a new instance of the Softlayer Compute service
        #
        # @param [Hash] options
        # @option options [String] :softlayer_api_url
        #   Override the default (or configured) API endpoint
        # @option options [String] :softlayer_username
        #   Email or user identifier for user based authentication
        # @option options [String] :softlayer_api_key
        #   Password for user based authentication
        #
        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

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

      end
    end
  end
end

Version data entries

60 entries across 58 versions & 3 rubygems

Version Path
fog-softlayer-0.4.1 lib/fog/softlayer/compute/shared.rb
fog-softlayer-0.4.0 lib/fog/softlayer/compute/shared.rb
fog-softlayer-0.3.30 lib/fog/softlayer/compute/shared.rb
fog-softlayer-0.3.29 lib/fog/softlayer/compute/shared.rb
fog-softlayer-0.3.28 lib/fog/softlayer/compute/shared.rb
fog-softlayer-0.3.27 lib/fog/softlayer/compute/shared.rb
fog-softlayer-0.3.26 lib/fog/softlayer/compute/shared.rb
fog-softlayer-0.3.25 lib/fog/softlayer/compute/shared.rb
fog-softlayer-0.3.24 lib/fog/softlayer/compute/shared.rb
fog-softlayer-0.3.23 lib/fog/softlayer/compute/shared.rb
fog-softlayer-0.3.22 lib/fog/softlayer/compute/shared.rb
fog-softlayer-0.3.21 lib/fog/softlayer/compute/shared.rb
fog-softlayer-0.3.20 lib/fog/softlayer/compute/shared.rb
fog-softlayer-0.3.19 lib/fog/softlayer/compute/shared.rb
fog-softlayer-0.3.18 lib/fog/softlayer/compute/shared.rb
fog-softlayer-0.3.17 lib/fog/softlayer/compute/shared.rb
fog-softlayer-0.3.16 lib/fog/softlayer/compute/shared.rb
fog-softlayer-0.3.15 lib/fog/softlayer/compute/shared.rb
fog-softlayer-0.3.14 lib/fog/softlayer/compute/shared.rb
fog-softlayer-0.3.13 lib/fog/softlayer/compute/shared.rb