Class: EasyPost::Services::Parcel
- Defined in:
- lib/easypost/services/parcel.rb
Constant Summary collapse
Instance Method Summary collapse
-
#create(params = {}) ⇒ Object
Create a Parcel object.
-
#retrieve(id) ⇒ Object
Retrieve a Parcel object.
Methods inherited from Service
Constructor Details
This class inherits a constructor from EasyPost::Services::Service
Instance Method Details
#create(params = {}) ⇒ Object
Create a Parcel object
7 8 9 10 11 12 |
# File 'lib/easypost/services/parcel.rb', line 7 def create(params = {}) wrapped_params = { parcel: params } response = @client.make_request(:post, 'parcels', wrapped_params) EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS) end |
#retrieve(id) ⇒ Object
Retrieve a Parcel object
15 16 17 18 19 |
# File 'lib/easypost/services/parcel.rb', line 15 def retrieve(id) response = @client.make_request(:get, "parcels/#{id}") EasyPost::InternalUtilities::Json.convert_json_to_object(response, MODEL_CLASS) end |