class Taxjar::Client

Attributes

api_key[RW]
api_url[RW]
headers[RW]
http_proxy[RW]

Public Class Methods

new(options = {}) { |self| ... } click to toggle source
# File lib/taxjar/client.rb, line 21
def initialize(options = {})
  options.each do |key, value|
    instance_variable_set("@#{key}", value)
  end
  yield(self) if block_given?
end

Public Instance Methods

api_key?() click to toggle source
# File lib/taxjar/client.rb, line 28
def api_key?
  !!@api_key
end
get_api_config(key) click to toggle source
# File lib/taxjar/client.rb, line 36
def get_api_config(key)
  instance_variable_get("@#{key}")
end
platform() click to toggle source
# File lib/taxjar/client.rb, line 41
def platform
  (`uname -a` || '').strip
rescue Errno::ENOENT, Errno::ENOMEM
  ''
end
set_api_config(key, value) click to toggle source
# File lib/taxjar/client.rb, line 32
def set_api_config(key, value)
  instance_variable_set("@#{key}", value)
end
user_agent() click to toggle source
# File lib/taxjar/client.rb, line 40
def user_agent
  def platform
    (`uname -a` || '').strip
  rescue Errno::ENOENT, Errno::ENOMEM
    ''
  end
  ruby_version = "ruby #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"
  openSSL_version = OpenSSL::OPENSSL_LIBRARY_VERSION
  "TaxJar/Ruby (#{platform}; #{ruby_version}; #{openSSL_version}) taxjar-ruby/#{Taxjar::Version}"
end