Class: Raas::OrderSummaryModel
- Defined in:
- lib/raas/models/order_summary_model.rb
Overview
Represents an Order Summary
Instance Attribute Summary collapse
-
#account_identifier ⇒ String
The account identifier.
-
#account_number ⇒ String
The account number.
-
#amount_charged ⇒ CurrencyBreakdownModel
The order amount information.
-
#created_at ⇒ DateTime
The date the order was placed.
-
#customer_identifier ⇒ String
The customer identifier.
-
#etid ⇒ String
The order’s email template id.
-
#margin_share ⇒ CurrencyBreakdownModel
The margin share information.
-
#recipient ⇒ NameEmailModel
The recipient’s information.
-
#reference_order_id ⇒ String
The reference order id.
-
#reward_name ⇒ String
The reward’s name.
-
#send_email ⇒ Boolean
Indicates if an an email was sent to the recipient.
-
#sender ⇒ NameEmailModel
The sender’s information.
-
#status ⇒ String
The order’s status.
-
#utid ⇒ String
The UTID.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(reference_order_id = nil, customer_identifier = nil, account_identifier = nil, account_number = nil, amount_charged = nil, margin_share = nil, utid = nil, reward_name = nil, sender = nil, recipient = nil, send_email = nil, status = nil, created_at = nil, etid = nil) ⇒ OrderSummaryModel
constructor
A new instance of OrderSummaryModel.
Methods inherited from BaseModel
Constructor Details
#initialize(reference_order_id = nil, customer_identifier = nil, account_identifier = nil, account_number = nil, amount_charged = nil, margin_share = nil, utid = nil, reward_name = nil, sender = nil, recipient = nil, send_email = nil, status = nil, created_at = nil, etid = nil) ⇒ OrderSummaryModel
Returns a new instance of OrderSummaryModel.
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/raas/models/order_summary_model.rb', line 84 def initialize(reference_order_id = nil, customer_identifier = nil, account_identifier = nil, account_number = nil, amount_charged = nil, margin_share = nil, utid = nil, reward_name = nil, sender = nil, recipient = nil, send_email = nil, status = nil, created_at = nil, etid = nil) @reference_order_id = reference_order_id @customer_identifier = customer_identifier @account_identifier = account_identifier @account_number = account_number @amount_charged = amount_charged @margin_share = margin_share @utid = utid @reward_name = reward_name @sender = sender @recipient = recipient @send_email = send_email @status = status @created_at = created_at @etid = etid end |
Instance Attribute Details
#account_identifier ⇒ String
The account identifier
18 19 20 |
# File 'lib/raas/models/order_summary_model.rb', line 18 def account_identifier @account_identifier end |
#account_number ⇒ String
The account number
22 23 24 |
# File 'lib/raas/models/order_summary_model.rb', line 22 def account_number @account_number end |
#amount_charged ⇒ CurrencyBreakdownModel
The order amount information
26 27 28 |
# File 'lib/raas/models/order_summary_model.rb', line 26 def amount_charged @amount_charged end |
#created_at ⇒ DateTime
The date the order was placed
58 59 60 |
# File 'lib/raas/models/order_summary_model.rb', line 58 def created_at @created_at end |
#customer_identifier ⇒ String
The customer identifier
14 15 16 |
# File 'lib/raas/models/order_summary_model.rb', line 14 def customer_identifier @customer_identifier end |
#etid ⇒ String
The order’s email template id
62 63 64 |
# File 'lib/raas/models/order_summary_model.rb', line 62 def etid @etid end |
#margin_share ⇒ CurrencyBreakdownModel
The margin share information
30 31 32 |
# File 'lib/raas/models/order_summary_model.rb', line 30 def margin_share @margin_share end |
#recipient ⇒ NameEmailModel
The recipient’s information
46 47 48 |
# File 'lib/raas/models/order_summary_model.rb', line 46 def recipient @recipient end |
#reference_order_id ⇒ String
The reference order id
10 11 12 |
# File 'lib/raas/models/order_summary_model.rb', line 10 def reference_order_id @reference_order_id end |
#reward_name ⇒ String
The reward’s name
38 39 40 |
# File 'lib/raas/models/order_summary_model.rb', line 38 def reward_name @reward_name end |
#send_email ⇒ Boolean
Indicates if an an email was sent to the recipient
50 51 52 |
# File 'lib/raas/models/order_summary_model.rb', line 50 def send_email @send_email end |
#sender ⇒ NameEmailModel
The sender’s information
42 43 44 |
# File 'lib/raas/models/order_summary_model.rb', line 42 def sender @sender end |
#status ⇒ String
The order’s status
54 55 56 |
# File 'lib/raas/models/order_summary_model.rb', line 54 def status @status end |
#utid ⇒ String
The UTID
34 35 36 |
# File 'lib/raas/models/order_summary_model.rb', line 34 def utid @utid end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
# File 'lib/raas/models/order_summary_model.rb', line 115 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. reference_order_id = hash['referenceOrderID'] customer_identifier = hash['customerIdentifier'] account_identifier = hash['accountIdentifier'] account_number = hash['accountNumber'] if hash['amountCharged'] amount_charged = CurrencyBreakdownModel.from_hash(hash['amountCharged']) end margin_share = CurrencyBreakdownModel.from_hash(hash['marginShare']) if hash['marginShare'] utid = hash['utid'] reward_name = hash['rewardName'] sender = NameEmailModel.from_hash(hash['sender']) if hash['sender'] recipient = NameEmailModel.from_hash(hash['recipient']) if hash['recipient'] send_email = hash['sendEmail'] status = hash['status'] created_at = APIHelper.rfc3339(hash['createdAt']) if hash['createdAt'] etid = hash['etid'] # Create object from extracted values. OrderSummaryModel.new(reference_order_id, customer_identifier, account_identifier, account_number, amount_charged, margin_share, utid, reward_name, sender, recipient, send_email, status, created_at, etid) end |
.names ⇒ Object
A mapping from model property names to API property names.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/raas/models/order_summary_model.rb', line 65 def self.names @_hash = {} if @_hash.nil? @_hash['reference_order_id'] = 'referenceOrderID' @_hash['customer_identifier'] = 'customerIdentifier' @_hash['account_identifier'] = 'accountIdentifier' @_hash['account_number'] = 'accountNumber' @_hash['amount_charged'] = 'amountCharged' @_hash['margin_share'] = 'marginShare' @_hash['utid'] = 'utid' @_hash['reward_name'] = 'rewardName' @_hash['sender'] = 'sender' @_hash['recipient'] = 'recipient' @_hash['send_email'] = 'sendEmail' @_hash['status'] = 'status' @_hash['created_at'] = 'createdAt' @_hash['etid'] = 'etid' @_hash end |