class EasyPost::Services::Parcel
Constants
- MODEL_CLASS
Parcel
objects represent the physical container being shipped.
Public Instance Methods
create(params = {})
click to toggle source
Create a Parcel
object
# 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)
click to toggle source
Retrieve a Parcel
object
# 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