class TaxCloud::Responses::TaxCodeGroups

Response to a TaxCloud getTICGroups API call.

api.taxcloud.net/1.0/TaxCloud.asmx?op=GetTICGroups

Public Class Methods

parse(savon_response) click to toggle source

Parse a TaxCloud response.

Parameters

savon_response

SOAP response.

Returns an array of Tax Code Groups.

# File lib/tax_cloud/responses/tax_code_groups.rb, line 17
def parse(savon_response)
  response = new(savon_response)
  tax_code_groups = response.match('get_tic_groups_response/get_tic_groups_result/tic_groups/tic_group')
  tax_code_groups.map do |tax_code_group|
    TaxCloud::TaxCodeGroup.new(
      group_id: tax_code_group[:group_id].to_i,
      description: tax_code_group[:description].strip
    )
  end
end