Class: TrueTrial::Types::TemporalElement
- Inherits:
-
Object
- Object
- TrueTrial::Types::TemporalElement
- Defined in:
- lib/truetrial/types/temporal_element.rb
Overview
Represents a temporal element (trial, warranty, subscription, etc.) returned from the TrueTrial API.
Instance Attribute Summary collapse
-
#begins_at ⇒ Object
readonly
Returns the value of attribute begins_at.
-
#cancelled_at ⇒ Object
readonly
Returns the value of attribute cancelled_at.
-
#converted_at ⇒ Object
readonly
Returns the value of attribute converted_at.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#duration_unit ⇒ Object
readonly
Returns the value of attribute duration_unit.
-
#expires_at ⇒ Object
readonly
Returns the value of attribute expires_at.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#order_id ⇒ Object
readonly
Returns the value of attribute order_id.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Class Method Summary collapse
-
.from_hash(hash) ⇒ TemporalElement
Builds a TemporalElement from an API response hash.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ TemporalElement
constructor
A new instance of TemporalElement.
Constructor Details
#initialize(attributes = {}) ⇒ TemporalElement
Returns a new instance of TemporalElement.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/truetrial/types/temporal_element.rb', line 12 def initialize(attributes = {}) @id = attributes["id"] @order_id = attributes["order_id"] @type = attributes["type"] @status = attributes["status"] @duration = attributes["duration"] @duration_unit = attributes["duration_unit"] @begins_at = attributes["begins_at"] @expires_at = attributes["expires_at"] @converted_at = attributes["converted_at"] @cancelled_at = attributes["cancelled_at"] @created_at = attributes["created_at"] @updated_at = attributes["updated_at"] end |
Instance Attribute Details
#begins_at ⇒ Object (readonly)
Returns the value of attribute begins_at.
8 9 10 |
# File 'lib/truetrial/types/temporal_element.rb', line 8 def begins_at @begins_at end |
#cancelled_at ⇒ Object (readonly)
Returns the value of attribute cancelled_at.
8 9 10 |
# File 'lib/truetrial/types/temporal_element.rb', line 8 def cancelled_at @cancelled_at end |
#converted_at ⇒ Object (readonly)
Returns the value of attribute converted_at.
8 9 10 |
# File 'lib/truetrial/types/temporal_element.rb', line 8 def converted_at @converted_at end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
8 9 10 |
# File 'lib/truetrial/types/temporal_element.rb', line 8 def created_at @created_at end |
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
8 9 10 |
# File 'lib/truetrial/types/temporal_element.rb', line 8 def duration @duration end |
#duration_unit ⇒ Object (readonly)
Returns the value of attribute duration_unit.
8 9 10 |
# File 'lib/truetrial/types/temporal_element.rb', line 8 def duration_unit @duration_unit end |
#expires_at ⇒ Object (readonly)
Returns the value of attribute expires_at.
8 9 10 |
# File 'lib/truetrial/types/temporal_element.rb', line 8 def expires_at @expires_at end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/truetrial/types/temporal_element.rb', line 8 def id @id end |
#order_id ⇒ Object (readonly)
Returns the value of attribute order_id.
8 9 10 |
# File 'lib/truetrial/types/temporal_element.rb', line 8 def order_id @order_id end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
8 9 10 |
# File 'lib/truetrial/types/temporal_element.rb', line 8 def status @status end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
8 9 10 |
# File 'lib/truetrial/types/temporal_element.rb', line 8 def type @type end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
8 9 10 |
# File 'lib/truetrial/types/temporal_element.rb', line 8 def updated_at @updated_at end |
Class Method Details
.from_hash(hash) ⇒ TemporalElement
Builds a TemporalElement from an API response hash.
31 32 33 |
# File 'lib/truetrial/types/temporal_element.rb', line 31 def self.from_hash(hash) new(hash) end |