Class: Slipmate::Order
- Inherits:
-
Object
- Object
- Slipmate::Order
- Defined in:
- lib/slipmate/order.rb
Instance Attribute Summary collapse
-
#is_held ⇒ Object
Returns the value of attribute is_held.
-
#message ⇒ Object
Returns the value of attribute message.
-
#order_date ⇒ Object
Returns the value of attribute order_date.
-
#order_type ⇒ Object
Returns the value of attribute order_type.
-
#origin_type ⇒ Object
Returns the value of attribute origin_type.
-
#shipping_address_1 ⇒ Object
Returns the value of attribute shipping_address_1.
-
#shipping_address_2 ⇒ Object
Returns the value of attribute shipping_address_2.
-
#shipping_amount ⇒ Object
Returns the value of attribute shipping_amount.
-
#shipping_city ⇒ Object
Returns the value of attribute shipping_city.
-
#shipping_company ⇒ Object
Returns the value of attribute shipping_company.
-
#shipping_first_name ⇒ Object
Returns the value of attribute shipping_first_name.
-
#shipping_last_name ⇒ Object
Returns the value of attribute shipping_last_name.
-
#shipping_method_code ⇒ Object
Returns the value of attribute shipping_method_code.
-
#shipping_special_instructions ⇒ Object
Returns the value of attribute shipping_special_instructions.
-
#shipping_state ⇒ Object
Returns the value of attribute shipping_state.
-
#shipping_tld ⇒ Object
Returns the value of attribute shipping_tld.
-
#shipping_zip ⇒ Object
Returns the value of attribute shipping_zip.
-
#status_hash ⇒ Object
Returns the value of attribute status_hash.
-
#store_code ⇒ Object
Returns the value of attribute store_code.
-
#supplier ⇒ Object
Returns the value of attribute supplier.
-
#tax ⇒ Object
Returns the value of attribute tax.
-
#xc_identifier ⇒ Object
Returns the value of attribute xc_identifier.
Instance Method Summary collapse
- #bang ⇒ Object
-
#initialize(attributes = {}) ⇒ Order
constructor
A new instance of Order.
- #serialize ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Order
Returns a new instance of Order.
33 34 35 36 37 38 |
# File 'lib/slipmate/order.rb', line 33 def initialize(attributes={}) attributes.reverse_merge! :order_date => DateTime.now, :is_held => false attributes.stringify_keys! attributes.each_pair{|key,value| send("#{key}=", value) if self.respond_to? "#{key}=" } end |
Instance Attribute Details
#is_held ⇒ Object
Returns the value of attribute is_held.
3 4 5 |
# File 'lib/slipmate/order.rb', line 3 def is_held @is_held end |
#message ⇒ Object
Returns the value of attribute message.
3 4 5 |
# File 'lib/slipmate/order.rb', line 3 def @message end |
#order_date ⇒ Object
Returns the value of attribute order_date.
3 4 5 |
# File 'lib/slipmate/order.rb', line 3 def order_date @order_date end |
#order_type ⇒ Object
Returns the value of attribute order_type.
3 4 5 |
# File 'lib/slipmate/order.rb', line 3 def order_type @order_type end |
#origin_type ⇒ Object
Returns the value of attribute origin_type.
3 4 5 |
# File 'lib/slipmate/order.rb', line 3 def origin_type @origin_type end |
#shipping_address_1 ⇒ Object
Returns the value of attribute shipping_address_1.
3 4 5 |
# File 'lib/slipmate/order.rb', line 3 def shipping_address_1 @shipping_address_1 end |
#shipping_address_2 ⇒ Object
Returns the value of attribute shipping_address_2.
3 4 5 |
# File 'lib/slipmate/order.rb', line 3 def shipping_address_2 @shipping_address_2 end |
#shipping_amount ⇒ Object
Returns the value of attribute shipping_amount.
3 4 5 |
# File 'lib/slipmate/order.rb', line 3 def shipping_amount @shipping_amount end |
#shipping_city ⇒ Object
Returns the value of attribute shipping_city.
3 4 5 |
# File 'lib/slipmate/order.rb', line 3 def shipping_city @shipping_city end |
#shipping_company ⇒ Object
Returns the value of attribute shipping_company.
3 4 5 |
# File 'lib/slipmate/order.rb', line 3 def shipping_company @shipping_company end |
#shipping_first_name ⇒ Object
Returns the value of attribute shipping_first_name.
3 4 5 |
# File 'lib/slipmate/order.rb', line 3 def shipping_first_name @shipping_first_name end |
#shipping_last_name ⇒ Object
Returns the value of attribute shipping_last_name.
3 4 5 |
# File 'lib/slipmate/order.rb', line 3 def shipping_last_name @shipping_last_name end |
#shipping_method_code ⇒ Object
Returns the value of attribute shipping_method_code.
3 4 5 |
# File 'lib/slipmate/order.rb', line 3 def shipping_method_code @shipping_method_code end |
#shipping_special_instructions ⇒ Object
Returns the value of attribute shipping_special_instructions.
3 4 5 |
# File 'lib/slipmate/order.rb', line 3 def shipping_special_instructions @shipping_special_instructions end |
#shipping_state ⇒ Object
Returns the value of attribute shipping_state.
3 4 5 |
# File 'lib/slipmate/order.rb', line 3 def shipping_state @shipping_state end |
#shipping_tld ⇒ Object
Returns the value of attribute shipping_tld.
3 4 5 |
# File 'lib/slipmate/order.rb', line 3 def shipping_tld @shipping_tld end |
#shipping_zip ⇒ Object
Returns the value of attribute shipping_zip.
3 4 5 |
# File 'lib/slipmate/order.rb', line 3 def shipping_zip @shipping_zip end |
#status_hash ⇒ Object
Returns the value of attribute status_hash.
3 4 5 |
# File 'lib/slipmate/order.rb', line 3 def status_hash @status_hash end |
#store_code ⇒ Object
Returns the value of attribute store_code.
3 4 5 |
# File 'lib/slipmate/order.rb', line 3 def store_code @store_code end |
#supplier ⇒ Object
Returns the value of attribute supplier.
3 4 5 |
# File 'lib/slipmate/order.rb', line 3 def supplier @supplier end |
#tax ⇒ Object
Returns the value of attribute tax.
3 4 5 |
# File 'lib/slipmate/order.rb', line 3 def tax @tax end |
#xc_identifier ⇒ Object
Returns the value of attribute xc_identifier.
3 4 5 |
# File 'lib/slipmate/order.rb', line 3 def xc_identifier @xc_identifier end |
Instance Method Details
#bang ⇒ Object
29 30 31 |
# File 'lib/slipmate/order.rb', line 29 def bang end |
#serialize ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/slipmate/order.rb', line 40 def serialize h={} self.instance_variables.each do |variab| h[variab[1..-1].to_sym] = self.instance_variable_get(variab) end h end |