Class: TaxCloud::TaxCode::Groups

Inherits:
Object
  • Object
show all
Defined in:
lib/tax_cloud/tax_code_groups.rb,
lib/tax_cloud/tax_code_group_constants.rb

Overview

Tax Code Groups.

Constant Summary collapse

ADMINISTRATIVE =

Administrative

1
2
3
4
DIGITAL_PRODUCTS =

Digital Products

5
FOOD_AND_FOOD_PRODUCTS =

Food and Food Products

6
PREPARED_FOOD =

Prepared Food

7
DRUGS =

Drugs

8
DURABLE_MEDICAL_EQUIPMENT =

Durable Medical Equipment

9
MOBILTY_ENHANCING_EQUIPMENT =

Mobilty Enhancing Equipment

10
PROSTHETIC_DEVICES =

Prosthetic Devices

11
TELECOMMUNICATIONS =

Telecommunications

12

Class Method Summary collapse

Class Method Details

.[](group_id) ⇒ Object

Lookup a tax code group by ID.

Parameters

group_id

Group ID.



19
20
21
# File 'lib/tax_cloud/tax_code_groups.rb', line 19

def [](group_id)
  all[group_id]
end

.allObject

All tax code groups.



7
8
9
10
11
12
13
# File 'lib/tax_cloud/tax_code_groups.rb', line 7

def all
  @tax_code_groups ||= begin
    response = TaxCloud.client.request :get_tic_groups
    tax_code_groups = TaxCloud::Responses::TaxCodeGroups.parse response
    Hash[tax_code_groups.map { |tax_code_group| [tax_code_group.group_id, tax_code_group] }]
  end
end