Class: Avatax::Api::TaxContent

Inherits:
Base
  • Object
show all
Defined in:
lib/avatax/api/tax_content.rb

Instance Attribute Summary

Attributes inherited from Base

#connection

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Avatax::Api::Base

Instance Method Details

#download_tax_rates_by_zipcode(date, args = {}, on_data = nil) ⇒ Object

Download taxrates by zipcode

Parameters:

  • date (Date)

    The date to get taxrates for

  • args (Hash) (defaults to: {})

    The query to send along

  • on_data (Proc) (defaults to: nil)
    • A lambda to run when data is received (For Streaming)

    See: lostisland.github.io/faraday/usage/streaming



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/avatax/api/tax_content.rb', line 12

def download_tax_rates_by_zipcode(date, args = {}, on_data = nil)
  response = connection.get do |request|
    request.url "/api/v2/taxratesbyzipcode/download/#{date}"
    request.params = args
    request.options.on_data = on_data if on_data
  end

  return if on_data

  handle_response(response)
end