Class: Cookie::Models::OrderResponse::Order

Inherits:
Object
  • Object
show all
Defined in:
lib/cookie/models/order_response.rb

Overview

Individual order details including purchase and payment information

Examples:

order = orders.orders.first
puts order.order_number # => "132747574"
puts order.number_purchased # => 2

Defined Under Namespace

Classes: PaymentAddress

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Order

Returns a new instance of Order.



31
32
33
34
35
36
37
38
# File 'lib/cookie/models/order_response.rb', line 31

def initialize(attributes)
  @date_actioned = attributes["dateActioned"]
  @number_purchased = attributes["numberPurchased"]
  @order_number = attributes["orderNumber"]
  @order_time_display = attributes["orderTimeDisplay"]
  @payment_address = PaymentAddress.new(attributes["paymentAddress"])
  @sales_application = attributes["salesApplication"]
end

Instance Attribute Details

#date_actionedObject (readonly)

Returns the value of attribute date_actioned.



28
29
30
# File 'lib/cookie/models/order_response.rb', line 28

def date_actioned
  @date_actioned
end

#number_purchasedObject (readonly)

Returns the value of attribute number_purchased.



28
29
30
# File 'lib/cookie/models/order_response.rb', line 28

def number_purchased
  @number_purchased
end

#order_numberObject (readonly)

Returns the value of attribute order_number.



28
29
30
# File 'lib/cookie/models/order_response.rb', line 28

def order_number
  @order_number
end

#order_time_displayObject (readonly)

Returns the value of attribute order_time_display.



28
29
30
# File 'lib/cookie/models/order_response.rb', line 28

def order_time_display
  @order_time_display
end

#payment_addressObject (readonly)

Returns the value of attribute payment_address.



28
29
30
# File 'lib/cookie/models/order_response.rb', line 28

def payment_address
  @payment_address
end

#sales_applicationObject (readonly)

Returns the value of attribute sales_application.



28
29
30
# File 'lib/cookie/models/order_response.rb', line 28

def sales_application
  @sales_application
end