Class: BigcommerceAPI::Shipment
- Defined in:
- lib/bigcommerce_api/shipment.rb
Instance Attribute Summary collapse
-
#billing_address ⇒ Object
Returns the value of attribute billing_address.
-
#comments ⇒ Object
Returns the value of attribute comments.
-
#customer_id ⇒ Object
Returns the value of attribute customer_id.
-
#date_created ⇒ Object
Returns the value of attribute date_created.
-
#id ⇒ Object
Returns the value of attribute id.
-
#items ⇒ Object
Returns the value of attribute items.
-
#order_address_id ⇒ Object
Returns the value of attribute order_address_id.
-
#order_id ⇒ Object
Returns the value of attribute order_id.
-
#shipping_address ⇒ Object
Returns the value of attribute shipping_address.
-
#shipping_method ⇒ Object
Returns the value of attribute shipping_method.
-
#tracking_number ⇒ Object
Returns the value of attribute tracking_number.
Attributes inherited from Resource
Class Method Summary collapse
Instance Method Summary collapse
- #find_for_reload ⇒ Object
- #parent ⇒ Object
-
#resource_url ⇒ Object
these are all overrides, since Shipments work a little differently.
Methods inherited from Resource
#assign_attributes, belongs_to, #changed, #create, #delete, has_many, has_one, http_request, #initialize, #mark_dirty!, #reload, #resource, resource, #save, #update_attributes
Methods inherited from Base
#attributes, clean!, date_adjust, default_options, #initialize, #store, #time, to_rfc2822
Constructor Details
This class inherits a constructor from BigcommerceAPI::Resource
Instance Attribute Details
#billing_address ⇒ Object
Returns the value of attribute billing_address.
3 4 5 |
# File 'lib/bigcommerce_api/shipment.rb', line 3 def billing_address @billing_address end |
#comments ⇒ Object
Returns the value of attribute comments.
3 4 5 |
# File 'lib/bigcommerce_api/shipment.rb', line 3 def comments @comments end |
#customer_id ⇒ Object
Returns the value of attribute customer_id.
3 4 5 |
# File 'lib/bigcommerce_api/shipment.rb', line 3 def customer_id @customer_id end |
#date_created ⇒ Object
Returns the value of attribute date_created.
3 4 5 |
# File 'lib/bigcommerce_api/shipment.rb', line 3 def date_created @date_created end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/bigcommerce_api/shipment.rb', line 3 def id @id end |
#items ⇒ Object
Returns the value of attribute items.
3 4 5 |
# File 'lib/bigcommerce_api/shipment.rb', line 3 def items @items end |
#order_address_id ⇒ Object
Returns the value of attribute order_address_id.
3 4 5 |
# File 'lib/bigcommerce_api/shipment.rb', line 3 def order_address_id @order_address_id end |
#order_id ⇒ Object
Returns the value of attribute order_id.
3 4 5 |
# File 'lib/bigcommerce_api/shipment.rb', line 3 def order_id @order_id end |
#shipping_address ⇒ Object
Returns the value of attribute shipping_address.
3 4 5 |
# File 'lib/bigcommerce_api/shipment.rb', line 3 def shipping_address @shipping_address end |
#shipping_method ⇒ Object
Returns the value of attribute shipping_method.
3 4 5 |
# File 'lib/bigcommerce_api/shipment.rb', line 3 def shipping_method @shipping_method end |
#tracking_number ⇒ Object
Returns the value of attribute tracking_number.
3 4 5 |
# File 'lib/bigcommerce_api/shipment.rb', line 3 def tracking_number @tracking_number end |
Class Method Details
.all(order_id, params = {}) ⇒ Object
33 34 35 36 |
# File 'lib/bigcommerce_api/shipment.rb', line 33 def all(order_id, params={}) resources = BigcommerceAPI::Base.get("/orders/#{order_id}/shipments", query: date_adjust(params)) (resources.success? and !resources.nil?) ? resources.collect{|r| self.new(r)} : [] end |
.find(order_id, id) ⇒ Object
38 39 40 41 |
# File 'lib/bigcommerce_api/shipment.rb', line 38 def find(order_id, id) r = BigcommerceAPI::Base.get("/orders/#{order_id}/shipments/#{id}") (r.success? and !r.nil?) ? self.new(r) : nil end |
Instance Method Details
#find_for_reload ⇒ Object
28 29 30 |
# File 'lib/bigcommerce_api/shipment.rb', line 28 def find_for_reload self.class.find(self.order_id, self.id) end |
#parent ⇒ Object
24 25 26 |
# File 'lib/bigcommerce_api/shipment.rb', line 24 def parent 'order' end |
#resource_url ⇒ Object
these are all overrides, since Shipments work a little differently
20 21 22 |
# File 'lib/bigcommerce_api/shipment.rb', line 20 def resource_url "orders/#{self.order_id}/shipments" end |