Class: TaxCloud::TaxCodeGroup
- Defined in:
- lib/tax_cloud/tax_code_group.rb
Overview
A group of tax codes.
See taxcloud.net/tic.
Instance Attribute Summary collapse
-
#description ⇒ Object
Group description.
-
#group_id ⇒ Object
Group ID.
Instance Method Summary collapse
-
#[](ticid) ⇒ Object
Lookup a tax code by ID.
-
#tax_codes ⇒ Object
All Tax Codes in this group.
Methods inherited from Record
Constructor Details
This class inherits a constructor from TaxCloud::Record
Instance Attribute Details
#description ⇒ Object
Group description.
9 10 11 |
# File 'lib/tax_cloud/tax_code_group.rb', line 9 def description @description end |
#group_id ⇒ Object
Group ID.
7 8 9 |
# File 'lib/tax_cloud/tax_code_group.rb', line 7 def group_id @group_id end |
Instance Method Details
#[](ticid) ⇒ Object
Lookup a tax code by ID.
Parameters
- ticid
-
Tax code ID.
24 25 26 |
# File 'lib/tax_cloud/tax_code_group.rb', line 24 def [](ticid) tax_codes[ticid] end |
#tax_codes ⇒ Object
All Tax Codes in this group.
12 13 14 15 16 17 18 |
# File 'lib/tax_cloud/tax_code_group.rb', line 12 def tax_codes @tax_codes ||= begin response = TaxCloud.client.request :get_ti_cs_by_group, tic_group: group_id tax_codes = TaxCloud::Responses::TaxCodesByGroup.parse response Hash[tax_codes.map { |tic| [tic.ticid, tic] }] end end |