Class: Slipmate::Order

Inherits:
Object
  • Object
show all
Defined in:
lib/slipmate/order.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_heldObject

Returns the value of attribute is_held.



3
4
5
# File 'lib/slipmate/order.rb', line 3

def is_held
  @is_held
end

#messageObject

Returns the value of attribute message.



3
4
5
# File 'lib/slipmate/order.rb', line 3

def message
  @message
end

#order_dateObject

Returns the value of attribute order_date.



3
4
5
# File 'lib/slipmate/order.rb', line 3

def order_date
  @order_date
end

#order_typeObject

Returns the value of attribute order_type.



3
4
5
# File 'lib/slipmate/order.rb', line 3

def order_type
  @order_type
end

#origin_typeObject

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_1Object

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_2Object

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_amountObject

Returns the value of attribute shipping_amount.



3
4
5
# File 'lib/slipmate/order.rb', line 3

def shipping_amount
  @shipping_amount
end

#shipping_cityObject

Returns the value of attribute shipping_city.



3
4
5
# File 'lib/slipmate/order.rb', line 3

def shipping_city
  @shipping_city
end

#shipping_companyObject

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_nameObject

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_nameObject

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_codeObject

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_instructionsObject

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_stateObject

Returns the value of attribute shipping_state.



3
4
5
# File 'lib/slipmate/order.rb', line 3

def shipping_state
  @shipping_state
end

#shipping_tldObject

Returns the value of attribute shipping_tld.



3
4
5
# File 'lib/slipmate/order.rb', line 3

def shipping_tld
  @shipping_tld
end

#shipping_zipObject

Returns the value of attribute shipping_zip.



3
4
5
# File 'lib/slipmate/order.rb', line 3

def shipping_zip
  @shipping_zip
end

#status_hashObject

Returns the value of attribute status_hash.



3
4
5
# File 'lib/slipmate/order.rb', line 3

def status_hash
  @status_hash
end

#store_codeObject

Returns the value of attribute store_code.



3
4
5
# File 'lib/slipmate/order.rb', line 3

def store_code
  @store_code
end

#supplierObject

Returns the value of attribute supplier.



3
4
5
# File 'lib/slipmate/order.rb', line 3

def supplier
  @supplier
end

#taxObject

Returns the value of attribute tax.



3
4
5
# File 'lib/slipmate/order.rb', line 3

def tax
  @tax
end

#xc_identifierObject

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

#bangObject



29
30
31
# File 'lib/slipmate/order.rb', line 29

def bang 
  
end

#serializeObject



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