Class: YellowApi::Client
- Inherits:
-
Object
- Object
- YellowApi::Client
- 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
Constants included from GetBusinessDetails
GetBusinessDetails::PROVINCE_ABBREVIATION_MAP
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ YellowApi::Client
constructor
Initializes a new API object.
Methods included from GetTypeAhead
Methods included from FindDealer
Methods included from GetBusinessDetails
#expand_province, #get_business_details, #normalize
Methods included from FindBusiness
Methods included from Request
Constructor Details
#initialize(attrs = {}) ⇒ YellowApi::Client
Initializes a new API object
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..merge(attrs) Config::VALID_OPTIONS_KEYS.each do |k| instance_variable_set("@#{k}".to_sym, attrs[k]) end end |