Sha256: 11e5c9ac31518e768f3406b6919a7138b81a478b424b0fc9aae0b891ae8fe1ff

Contents?: true

Size: 1011 Bytes

Versions: 2

Compression:

Stored size: 1011 Bytes

Contents

require 'yellow_api/config'
require 'yellow_api/client/connection'
require 'yellow_api/client/request'
require 'yellow_api/client/find_business'
require 'yellow_api/client/get_business_details'
require 'yellow_api/client/find_dealer'
require 'yellow_api/client/get_type_ahead'

module YellowApi
  class Client
    include YellowApi::Client::Connection
    include YellowApi::Client::Request

    include YellowApi::Client::FindBusiness
    include YellowApi::Client::GetBusinessDetails
    include YellowApi::Client::FindDealer
    include YellowApi::Client::GetTypeAhead

    attr_accessor *Config::VALID_OPTIONS_KEYS

    # Initializes a new API object
    #
    # @param attrs [Hash]
    # @return [YellowApi::Client]
    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
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
yellow-api-wrapper-0.0.2 lib/yellow_api/client.rb
yellow-api-wrapper-0.0.1 lib/yellow_api/client.rb