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