Class: YellowApi::Client

Inherits:
Object
  • Object
show all
Includes:
Connection, FindBusiness, FindDealer, GetBusinessDetails, GetTypeAhead, Request
Defined in:
lib/yellow_api/client.rb,
lib/yellow_api/client/request.rb,
lib/yellow_api/client/connection.rb,
lib/yellow_api/client/find_dealer.rb,
lib/yellow_api/client/find_business.rb,
lib/yellow_api/client/get_type_ahead.rb,
lib/yellow_api/client/get_business_details.rb

Defined Under Namespace

Modules: Connection, FindBusiness, FindDealer, GetBusinessDetails, GetTypeAhead, Request

Constant Summary

Constant Summary

Constants included from GetBusinessDetails

GetBusinessDetails::PROVINCE_ABBREVIATION_MAP

Instance Method Summary collapse

Methods included from GetTypeAhead

#get_type_ahead

Methods included from FindDealer

#find_dealer

Methods included from GetBusinessDetails

#expand_province, #get_business_details, #normalize

Methods included from FindBusiness

#find_business

Methods included from Request

#get, #request, #uid

Constructor Details

#initialize(attrs = {}) ⇒ YellowApi::Client

Initializes a new API object

Parameters:

  • attrs (Hash) (defaults to: {})


25
26
27
28
29
30
31
# File 'lib/yellow_api/client.rb', line 25

def initialize(attrs={})
  YellowApi.reset #TODO: this shouldn't be required since I'm extending config?
  attrs = YellowApi.options.merge(attrs)
  Config::VALID_OPTIONS_KEYS.each do |k|
    instance_variable_set("@#{k}".to_sym, attrs[k])
  end
end