Class: Taxjar::Client

Inherits:
Object
  • Object
show all
Includes:
API, API::Order, API::Refund
Defined in:
lib/taxjar/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from API::Refund

#create_refund, #delete_refund, #list_refunds, #show_refund, #update_refund

Methods included from API::Utils

#perform_delete_with_object, #perform_get_with_array, #perform_get_with_object, #perform_get_with_objects, #perform_post_with_object, #perform_put_with_object, #perform_request, #perform_request_with_array, #perform_request_with_object, #perform_request_with_objects

Methods included from API::Order

#create_order, #delete_order, #list_orders, #show_order, #update_order

Methods included from API

#categories, #rates_for_location, #summary_rates, #tax_for_order, #validate

Constructor Details

#initialize(options = {}) {|_self| ... } ⇒ Client

Returns a new instance of Client.

Yields:

  • (_self)

Yield Parameters:



16
17
18
19
20
21
# File 'lib/taxjar/client.rb', line 16

def initialize(options = {})
  options.each do |key, value|
    instance_variable_set("@#{key}", value)
  end
  yield(self) if block_given?
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



14
15
16
# File 'lib/taxjar/client.rb', line 14

def api_key
  @api_key
end

Instance Method Details

#api_key?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/taxjar/client.rb', line 23

def api_key?
  !!@api_key
end

#user_agentObject



27
28
29
# File 'lib/taxjar/client.rb', line 27

def user_agent
  "TaxjarRubyGem/#{Taxjar::Version}"
end