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
- #parent ⇒ Object
-
#resource_url ⇒ Object
these are all overrides, since Shipments work a little differently.
Methods inherited from Resource
belongs_to, #create, has_many, has_one, #initialize, #resource, resource, #save
Methods inherited from Base
#attributes, clean!, date_adjust, #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.
4 5 6 |
# File 'lib/bigcommerce_api/shipment.rb', line 4 def billing_address @billing_address end |
#comments ⇒ Object
Returns the value of attribute comments.
4 5 6 |
# File 'lib/bigcommerce_api/shipment.rb', line 4 def comments @comments end |
#customer_id ⇒ Object
Returns the value of attribute customer_id.
4 5 6 |
# File 'lib/bigcommerce_api/shipment.rb', line 4 def customer_id @customer_id end |
#date_created ⇒ Object
Returns the value of attribute date_created.
4 5 6 |
# File 'lib/bigcommerce_api/shipment.rb', line 4 def date_created @date_created end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/bigcommerce_api/shipment.rb', line 4 def id @id end |
#items ⇒ Object
Returns the value of attribute items.
4 5 6 |
# File 'lib/bigcommerce_api/shipment.rb', line 4 def items @items end |
#order_address_id ⇒ Object
Returns the value of attribute order_address_id.
4 5 6 |
# File 'lib/bigcommerce_api/shipment.rb', line 4 def order_address_id @order_address_id end |
#order_id ⇒ Object
Returns the value of attribute order_id.
4 5 6 |
# File 'lib/bigcommerce_api/shipment.rb', line 4 def order_id @order_id end |
#shipping_address ⇒ Object
Returns the value of attribute shipping_address.
4 5 6 |
# File 'lib/bigcommerce_api/shipment.rb', line 4 def shipping_address @shipping_address end |
#shipping_method ⇒ Object
Returns the value of attribute shipping_method.
4 5 6 |
# File 'lib/bigcommerce_api/shipment.rb', line 4 def shipping_method @shipping_method end |
#tracking_number ⇒ Object
Returns the value of attribute tracking_number.
4 5 6 |
# File 'lib/bigcommerce_api/shipment.rb', line 4 def tracking_number @tracking_number end |
Class Method Details
.all(order_id, params = {}) ⇒ Object
18 19 20 21 |
# File 'lib/bigcommerce_api/shipment.rb', line 18 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
23 24 25 26 |
# File 'lib/bigcommerce_api/shipment.rb', line 23 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
#parent ⇒ Object
13 14 15 |
# File 'lib/bigcommerce_api/shipment.rb', line 13 def parent 'order' end |
#resource_url ⇒ Object
these are all overrides, since Shipments work a little differently
9 10 11 |
# File 'lib/bigcommerce_api/shipment.rb', line 9 def resource_url "orders/#{self.order_id}/shipments" end |