Class: TrueTrial::Types::Order
- Inherits:
-
Object
- Object
- TrueTrial::Types::Order
- Defined in:
- lib/truetrial/types/order.rb
Overview
Represents an order returned from the TrueTrial API.
Instance Attribute Summary collapse
-
#consumer_id ⇒ Object
readonly
Returns the value of attribute consumer_id.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#external_order_id ⇒ Object
readonly
Returns the value of attribute external_order_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#product_type ⇒ Object
readonly
Returns the value of attribute product_type.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#tenant_id ⇒ Object
readonly
Returns the value of attribute tenant_id.
-
#total_cents ⇒ Object
readonly
Returns the value of attribute total_cents.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Order
Builds an Order from an API response hash.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Order
constructor
A new instance of Order.
Constructor Details
#initialize(attributes = {}) ⇒ Order
Returns a new instance of Order.
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/truetrial/types/order.rb', line 11 def initialize(attributes = {}) @id = attributes["id"] @tenant_id = attributes["tenant_id"] @consumer_id = attributes["consumer_id"] @external_order_id = attributes["external_order_id"] @status = attributes["status"] @product_type = attributes["product_type"] @total_cents = attributes["total_cents"] @currency = attributes["currency"] @metadata = attributes["metadata"] @created_at = attributes["created_at"] @updated_at = attributes["updated_at"] end |
Instance Attribute Details
#consumer_id ⇒ Object (readonly)
Returns the value of attribute consumer_id.
7 8 9 |
# File 'lib/truetrial/types/order.rb', line 7 def consumer_id @consumer_id end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
7 8 9 |
# File 'lib/truetrial/types/order.rb', line 7 def created_at @created_at end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
7 8 9 |
# File 'lib/truetrial/types/order.rb', line 7 def currency @currency end |
#external_order_id ⇒ Object (readonly)
Returns the value of attribute external_order_id.
7 8 9 |
# File 'lib/truetrial/types/order.rb', line 7 def external_order_id @external_order_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/truetrial/types/order.rb', line 7 def id @id end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
7 8 9 |
# File 'lib/truetrial/types/order.rb', line 7 def @metadata end |
#product_type ⇒ Object (readonly)
Returns the value of attribute product_type.
7 8 9 |
# File 'lib/truetrial/types/order.rb', line 7 def product_type @product_type end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
7 8 9 |
# File 'lib/truetrial/types/order.rb', line 7 def status @status end |
#tenant_id ⇒ Object (readonly)
Returns the value of attribute tenant_id.
7 8 9 |
# File 'lib/truetrial/types/order.rb', line 7 def tenant_id @tenant_id end |
#total_cents ⇒ Object (readonly)
Returns the value of attribute total_cents.
7 8 9 |
# File 'lib/truetrial/types/order.rb', line 7 def total_cents @total_cents end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
7 8 9 |
# File 'lib/truetrial/types/order.rb', line 7 def updated_at @updated_at end |
Class Method Details
.from_hash(hash) ⇒ Order
Builds an Order from an API response hash.
29 30 31 |
# File 'lib/truetrial/types/order.rb', line 29 def self.from_hash(hash) new(hash) end |