class TaxCloud::Responses::TaxCodesByGroup

Response to a TaxCloud getTICsByGroup API call.

See asmx.taxcloud.com/1.0/TaxCloud.asmx?op=GetTICsByGroup.

Public Class Methods

parse(savon_response) click to toggle source

Parse a TaxCloud response.

Parameters

savon_response

SOAP response.

Returns an array of tax codes.

# File lib/tax_cloud/responses/tax_codes_by_group.rb, line 19
def parse(savon_response)
  response = new(savon_response)
  tax_codes = response.match('get_ti_cs_by_group_response/get_ti_cs_by_group_result/ti_cs/tic')
  tax_codes.map do |tax_code|
    TaxCloud::TaxCode.new(
      ticid: tax_code[:ticid].to_i,
      description: tax_code[:description]
    )
  end
end