Sha256: 46af286e92d2d1ead39d3550354e174a97dea286d41381e27cb99daa0a0fa817

Contents?: true

Size: 840 Bytes

Versions: 1

Compression:

Stored size: 840 Bytes

Contents

require 'addressable/template'

module Bubbles
  class RestEnvironment
    attr_accessor :scheme, :host, :port, :api_key

    ##
    # Construct a new instance of +RestEnvironment+.
    #
    # @param [String] scheme The scheme to use for communicating with the host. Currently, http and https are supported.
    # @param [String] host The host to communicate with.
    # @param [Integer] port The port on which the communication channel should operate.
    # @param [String] api_key (Optional) The API key to use to identify your client with the API. Defaults to +nil+.
    #
    def initialize(scheme='https', host='api.foamfactory.com', port=443, api_key=nil)
      @scheme = scheme
      @port = port

      if @scheme == 'http' && @port == 443
        @port = 80
      end

      @host = host
      @api_key = api_key
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bubbles-rest-client-0.1.0 lib/bubbles/rest_environment.rb