Class: Cookie::Models::OrderResponse
- Inherits:
-
BaseResponse
- Object
- BaseResponse
- Cookie::Models::OrderResponse
- Defined in:
- lib/cookie/models/order_response.rb
Overview
Response containing order information and details
Defined Under Namespace
Classes: Order
Instance Attribute Summary collapse
-
#can_view_details ⇒ Object
readonly
Returns the value of attribute can_view_details.
-
#orders ⇒ Object
readonly
Returns the value of attribute orders.
-
#total_order_count ⇒ Object
readonly
Returns the value of attribute total_order_count.
Attributes inherited from BaseResponse
#error_code, #error_message, #expired, #type
Instance Method Summary collapse
-
#initialize(attributes) ⇒ OrderResponse
constructor
A new instance of OrderResponse.
Methods inherited from BaseResponse
#authentication_error?, #error?
Constructor Details
#initialize(attributes) ⇒ OrderResponse
Returns a new instance of OrderResponse.
14 15 16 17 18 19 |
# File 'lib/cookie/models/order_response.rb', line 14 def initialize(attributes) super @can_view_details = attributes["canViewDetails"] @total_order_count = attributes["totalOrderCount"] @orders = (attributes["orders"] || []).map { |order| Order.new(order) } end |
Instance Attribute Details
#can_view_details ⇒ Object (readonly)
Returns the value of attribute can_view_details.
12 13 14 |
# File 'lib/cookie/models/order_response.rb', line 12 def can_view_details @can_view_details end |
#orders ⇒ Object (readonly)
Returns the value of attribute orders.
12 13 14 |
# File 'lib/cookie/models/order_response.rb', line 12 def orders @orders end |
#total_order_count ⇒ Object (readonly)
Returns the value of attribute total_order_count.
12 13 14 |
# File 'lib/cookie/models/order_response.rb', line 12 def total_order_count @total_order_count end |