Class: ShipEngine::Domain::Manifests
- Inherits:
-
Object
- Object
- ShipEngine::Domain::Manifests
- Defined in:
- lib/shipengine/domains/manifests.rb
Instance Method Summary collapse
- #create_manifest(params: {}) ⇒ Object
-
#initialize ⇒ Manifests
constructor
A new instance of Manifests.
- #list_manifests(params: {}) ⇒ Object
- #manifest_by_id(manifest_id:, params: {}) ⇒ Object
- #manifest_request_by_id(manifest_request_id:, params: {}) ⇒ Object
Constructor Details
#initialize ⇒ Manifests
Returns a new instance of Manifests.
8 9 10 |
# File 'lib/shipengine/domains/manifests.rb', line 8 def initialize @client = ShipEngine::Client.new end |
Instance Method Details
#create_manifest(params: {}) ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/shipengine/domains/manifests.rb', line 21 def create_manifest(params: {}) response = @client.post( path: ShipEngine::Constants::PATHS.v1.manifests.root, options: params ) Hashie::Mash.new(response.body) end |
#list_manifests(params: {}) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/shipengine/domains/manifests.rb', line 12 def list_manifests(params: {}) response = @client.get( path: ShipEngine::Constants::PATHS.v1.manifests.root, options: params ) Hashie::Mash.new(response.body) end |
#manifest_by_id(manifest_id:, params: {}) ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/shipengine/domains/manifests.rb', line 30 def manifest_by_id(manifest_id:, params: {}) response = @client.get( path: "#{ShipEngine::Constants::PATHS.v1.manifests.root}/#{manifest_id}", options: params ) Hashie::Mash.new(response.body) end |
#manifest_request_by_id(manifest_request_id:, params: {}) ⇒ Object
39 40 41 42 43 44 45 46 |
# File 'lib/shipengine/domains/manifests.rb', line 39 def manifest_request_by_id(manifest_request_id:, params: {}) response = @client.get( path: "#{ShipEngine::Constants::PATHS.v1.manifests.manifest_request}/#{manifest_request_id}", options: params ) Hashie::Mash.new(response.body) end |