Module: Uk::HsCode

Defined in:
lib/uk/hs_code.rb,
lib/uk/hs_code/record.rb,
lib/uk/hs_code/version.rb,
lib/uk/hs_code/api_request.rb

Defined Under Namespace

Classes: ApiRequest, Error, Record

Constant Summary collapse

API_ENDPOINT =
"https://www.trade-tariff.service.gov.uk/api"
VERSION =
"0.1.2"

Class Method Summary collapse

Class Method Details

.search(query) ⇒ Object



14
15
16
# File 'lib/uk/hs_code.rb', line 14

def search(query)
  search_references(query)
end

.search_hs_codes(query) ⇒ Object



18
19
20
21
# File 'lib/uk/hs_code.rb', line 18

def search_hs_codes(query)
  result = search_references(query)
  result.map { |a| Record.new(code: a.attributes.goods_nomenclature_item_id, title: a.attributes.title) }
end