Class: Taxjar::Client
- Inherits:
-
Object
- Object
- Taxjar::Client
- Includes:
- API, API::Customer, API::Order, API::Refund
- Defined in:
- lib/taxjar/client.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#api_url ⇒ Object
Returns the value of attribute api_url.
-
#headers ⇒ Object
Returns the value of attribute headers.
Instance Method Summary collapse
- #api_key? ⇒ Boolean
- #get_api_config(key) ⇒ Object
-
#initialize(options = {}) {|_self| ... } ⇒ Client
constructor
A new instance of Client.
- #set_api_config(key, value) ⇒ Object
- #user_agent ⇒ Object
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::Customer
#create_customer, #delete_customer, #list_customers, #show_customer, #update_customer
Methods included from API
#categories, #nexus_regions, #rates_for_location, #summary_rates, #tax_for_order, #validate
Constructor Details
#initialize(options = {}) {|_self| ... } ⇒ Client
Returns a new instance of Client.
20 21 22 23 24 25 |
# File 'lib/taxjar/client.rb', line 20 def initialize( = {}) .each do |key, value| instance_variable_set("@#{key}", value) end yield(self) if block_given? end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
16 17 18 |
# File 'lib/taxjar/client.rb', line 16 def api_key @api_key end |
#api_url ⇒ Object
Returns the value of attribute api_url.
17 18 19 |
# File 'lib/taxjar/client.rb', line 17 def api_url @api_url end |
#headers ⇒ Object
Returns the value of attribute headers.
18 19 20 |
# File 'lib/taxjar/client.rb', line 18 def headers @headers end |
Instance Method Details
#api_key? ⇒ Boolean
27 28 29 |
# File 'lib/taxjar/client.rb', line 27 def api_key? !!@api_key end |
#get_api_config(key) ⇒ Object
35 36 37 |
# File 'lib/taxjar/client.rb', line 35 def get_api_config(key) instance_variable_get("@#{key}") end |
#set_api_config(key, value) ⇒ Object
31 32 33 |
# File 'lib/taxjar/client.rb', line 31 def set_api_config(key, value) instance_variable_set("@#{key}", value) end |