Sha256: f5e46be4fa16c3a72e7640b2ef082c368d80b277e9665dba64c72158592f001e

Contents?: true

Size: 780 Bytes

Versions: 8

Compression:

Stored size: 780 Bytes

Contents

class Configuration

  attr_accessor :user_id
  attr_accessor :password
  attr_accessor :basic_credentials

  attr_accessor :cache_enabled

  attr_accessor :tract_api_host
  attr_accessor :tract_api_url

  #
  # initialize
  #
  def initialize
    @tract_api_host ||= "https://my.tractbilling.com"
    @tract_api_url = "#{@tract_api_host}/t/s/r/#{GoTransverseTractApi::TARGET_API_VERSION}"
    set_basic_credentials
  end

  private

  #
  # set_basic_credentials
  #
  def set_basic_credentials

    # Perform Base-64 encoding of API login information
    user_pass = "#{@user_id.to_s}:#{@password.to_s}"

    # Sets basic_credentials attr_accessor
    @basic_credentials = Base64.encode64(user_pass)

    # Erase in-clear credentials
    @user_id = @password = nil

  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
gotransverse-tract-api-0.1.7 lib/gotransverse-tract-api/configuration.rb
gotransverse-tract-api-0.1.6 lib/gotransverse-tract-api/configuration.rb
gotransverse-tract-api-0.1.5 lib/gotransverse-tract-api/configuration.rb
gotransverse-tract-api-0.1.4 lib/gotransverse-tract-api/configuration.rb
gotransverse-tract-api-0.1.3 lib/gotransverse-tract-api/configuration.rb
gotransverse-tract-api-0.1.2 lib/gotransverse-tract-api/configuration.rb
gotransverse-tract-api-0.1.1 lib/gotransverse-tract-api/configuration.rb
gotransverse-tract-api-0.1.0 lib/gotransverse-tract-api/configuration.rb