Class: BigcommerceAPI::Shippingaddress
- Defined in:
- lib/bigcommerce_api/shippingaddress.rb
Instance Attribute Summary collapse
-
#base_cost ⇒ Object
Returns the value of attribute base_cost.
-
#base_handling_cost ⇒ Object
Returns the value of attribute base_handling_cost.
-
#city ⇒ Object
Returns the value of attribute city.
-
#company ⇒ Object
Returns the value of attribute company.
-
#cost_ex_tax ⇒ Object
Returns the value of attribute cost_ex_tax.
-
#cost_inc_tax ⇒ Object
Returns the value of attribute cost_inc_tax.
-
#cost_tax ⇒ Object
Returns the value of attribute cost_tax.
-
#cost_tax_class_id ⇒ Object
Returns the value of attribute cost_tax_class_id.
-
#country ⇒ Object
Returns the value of attribute country.
-
#country_iso2 ⇒ Object
Returns the value of attribute country_iso2.
-
#email ⇒ Object
Returns the value of attribute email.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#handling_cost_ex_tax ⇒ Object
Returns the value of attribute handling_cost_ex_tax.
-
#handling_cost_inc_tax ⇒ Object
Returns the value of attribute handling_cost_inc_tax.
-
#handling_cost_tax ⇒ Object
Returns the value of attribute handling_cost_tax.
-
#handling_cost_tax_class_id ⇒ Object
Returns the value of attribute handling_cost_tax_class_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#items_shipped ⇒ Object
Returns the value of attribute items_shipped.
-
#items_total ⇒ Object
Returns the value of attribute items_total.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#order_id ⇒ Object
Returns the value of attribute order_id.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#shipping_method ⇒ Object
Returns the value of attribute shipping_method.
-
#shipping_zone_id ⇒ Object
Returns the value of attribute shipping_zone_id.
-
#shipping_zone_name ⇒ Object
Returns the value of attribute shipping_zone_name.
-
#state ⇒ Object
Returns the value of attribute state.
-
#street_1 ⇒ Object
Returns the value of attribute street_1.
-
#street_2 ⇒ Object
Returns the value of attribute street_2.
-
#zip ⇒ Object
Returns the value of attribute zip.
Attributes inherited from Resource
Class Method Summary collapse
Instance Method Summary collapse
- #create(params = {}) ⇒ Object
- #find_for_reload ⇒ Object
- #parent ⇒ Object
-
#resource_url ⇒ Object
this overrides the default method, since this has to come in with an order id.
-
#save ⇒ Object
TODO: these can probably go in a ReadOnly class.
Methods inherited from Resource
belongs_to, #changed, has_many, has_one, http_request, #initialize, #mark_dirty!, #reload, #resource, resource
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
#base_cost ⇒ Object
Returns the value of attribute base_cost.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def base_cost @base_cost end |
#base_handling_cost ⇒ Object
Returns the value of attribute base_handling_cost.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def base_handling_cost @base_handling_cost end |
#city ⇒ Object
Returns the value of attribute city.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def city @city end |
#company ⇒ Object
Returns the value of attribute company.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def company @company end |
#cost_ex_tax ⇒ Object
Returns the value of attribute cost_ex_tax.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def cost_ex_tax @cost_ex_tax end |
#cost_inc_tax ⇒ Object
Returns the value of attribute cost_inc_tax.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def cost_inc_tax @cost_inc_tax end |
#cost_tax ⇒ Object
Returns the value of attribute cost_tax.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def cost_tax @cost_tax end |
#cost_tax_class_id ⇒ Object
Returns the value of attribute cost_tax_class_id.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def cost_tax_class_id @cost_tax_class_id end |
#country ⇒ Object
Returns the value of attribute country.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def country @country end |
#country_iso2 ⇒ Object
Returns the value of attribute country_iso2.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def country_iso2 @country_iso2 end |
#email ⇒ Object
Returns the value of attribute email.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def email @email end |
#first_name ⇒ Object
Returns the value of attribute first_name.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def first_name @first_name end |
#handling_cost_ex_tax ⇒ Object
Returns the value of attribute handling_cost_ex_tax.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def handling_cost_ex_tax @handling_cost_ex_tax end |
#handling_cost_inc_tax ⇒ Object
Returns the value of attribute handling_cost_inc_tax.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def handling_cost_inc_tax @handling_cost_inc_tax end |
#handling_cost_tax ⇒ Object
Returns the value of attribute handling_cost_tax.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def handling_cost_tax @handling_cost_tax end |
#handling_cost_tax_class_id ⇒ Object
Returns the value of attribute handling_cost_tax_class_id.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def handling_cost_tax_class_id @handling_cost_tax_class_id end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def id @id end |
#items_shipped ⇒ Object
Returns the value of attribute items_shipped.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def items_shipped @items_shipped end |
#items_total ⇒ Object
Returns the value of attribute items_total.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def items_total @items_total end |
#last_name ⇒ Object
Returns the value of attribute last_name.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def last_name @last_name end |
#order_id ⇒ Object
Returns the value of attribute order_id.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def order_id @order_id end |
#phone ⇒ Object
Returns the value of attribute phone.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def phone @phone end |
#shipping_method ⇒ Object
Returns the value of attribute shipping_method.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def shipping_method @shipping_method end |
#shipping_zone_id ⇒ Object
Returns the value of attribute shipping_zone_id.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def shipping_zone_id @shipping_zone_id end |
#shipping_zone_name ⇒ Object
Returns the value of attribute shipping_zone_name.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def shipping_zone_name @shipping_zone_name end |
#state ⇒ Object
Returns the value of attribute state.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def state @state end |
#street_1 ⇒ Object
Returns the value of attribute street_1.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def street_1 @street_1 end |
#street_2 ⇒ Object
Returns the value of attribute street_2.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def street_2 @street_2 end |
#zip ⇒ Object
Returns the value of attribute zip.
4 5 6 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 4 def zip @zip end |
Class Method Details
.all(order_id, params = {}) ⇒ Object
33 34 35 36 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 33 def all(order_id, params={}) resources = BigcommerceAPI::Base.get("/orders/#{order_id}/shippingaddresses", :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/shippingaddress.rb', line 38 def find(order_id, id) r = BigcommerceAPI::Base.get("/orders/#{order_id}/shippingaddresses/#{id}") (r.success? and !r.nil?) ? self.new(r) : nil end |
Instance Method Details
#create(params = {}) ⇒ Object
23 24 25 26 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 23 def create(params={}) self.errors = ["Shipping Addresses are readonly"] return false end |
#find_for_reload ⇒ Object
28 29 30 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 28 def find_for_reload self.class.find(self.order_id, self.id) end |
#parent ⇒ Object
13 14 15 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 13 def parent 'order' end |
#resource_url ⇒ Object
this overrides the default method, since this has to come in with an order id
9 10 11 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 9 def resource_url "orders/#{self.order_id}/shippingaddresses" end |
#save ⇒ Object
TODO: these can probably go in a ReadOnly class
18 19 20 21 |
# File 'lib/bigcommerce_api/shippingaddress.rb', line 18 def save self.errors = ["Shipping Addresses are readonly"] return false end |