Class: FlexOps::Resources::HsCodes
- Inherits:
-
Object
- Object
- FlexOps::Resources::HsCodes
- Defined in:
- lib/flexops/resources/hs_codes.rb
Instance Method Summary collapse
- #estimate_landed_cost(request) ⇒ Object
-
#initialize(http, ws_id_proc) ⇒ HsCodes
constructor
A new instance of HsCodes.
- #lookup(code) ⇒ Object
- #search(query, destination_country: nil, max_results: 10) ⇒ Object
Constructor Details
#initialize(http, ws_id_proc) ⇒ HsCodes
Returns a new instance of HsCodes.
14 15 16 17 |
# File 'lib/flexops/resources/hs_codes.rb', line 14 def initialize(http, ws_id_proc) @http = http @ws_id = ws_id_proc end |
Instance Method Details
#estimate_landed_cost(request) ⇒ Object
28 29 30 |
# File 'lib/flexops/resources/hs_codes.rb', line 28 def estimate_landed_cost(request) @http.post("#{ws_path}/shipping/landed-cost", body: request) end |
#lookup(code) ⇒ Object
24 25 26 |
# File 'lib/flexops/resources/hs_codes.rb', line 24 def lookup(code) @http.get("#{ws_path}/shipping/hs-codes/#{code}") end |
#search(query, destination_country: nil, max_results: 10) ⇒ Object
19 20 21 22 |
# File 'lib/flexops/resources/hs_codes.rb', line 19 def search(query, destination_country: nil, max_results: 10) params = { query: query, destinationCountry: destination_country, maxResults: max_results }.compact @http.get("#{ws_path}/shipping/hs-codes/search", query: params) end |