Class: ModernTreasury::PaperItem
- Defined in:
- lib/modern_treasury/models/paper_item.rb
Overview
PaperItem Model.
Instance Attribute Summary collapse
-
#account_number ⇒ String
The account number on the paper item.
-
#account_number_safe ⇒ String
The last 4 digits of the account_number.
-
#amount ⇒ Integer
The amount of the paper item.
-
#check_number ⇒ String
The check number on the paper item.
-
#created_at ⇒ DateTime
This field will be true if this object exists in the live environment or false if it exists in the test environment.
-
#currency ⇒ Currency
Three-letter ISO currency code.
-
#deposit_date ⇒ Date
The date the paper item was deposited into your organization’s bank account.
-
#id ⇒ UUID | String
TODO: Write general description for this method.
-
#live_mode ⇒ TrueClass | FalseClass
This field will be true if this object exists in the live environment or false if it exists in the test environment.
-
#lockbox_number ⇒ String
The identifier for the lockbox assigned by the bank.
-
#memo_field ⇒ String
The memo field on the paper item.
-
#object ⇒ String
TODO: Write general description for this method.
-
#remitter_name ⇒ String
The name of the remitter on the paper item.
-
#routing_number ⇒ String
The routing number on the paper item.
-
#status ⇒ Status16
The current status of the paper item.
-
#transaction_id ⇒ UUID | String
The ID of the reconciled Transaction or ‘null`.
-
#transaction_line_item_id ⇒ UUID | String
The ID of the reconciled Transaction Line Item or ‘null`.
-
#updated_at ⇒ DateTime
This field will be true if this object exists in the live environment or false if it exists in the test environment.
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.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(id:, object:, live_mode:, created_at:, updated_at:, transaction_line_item_id:, transaction_id:, status:, lockbox_number:, deposit_date:, amount:, currency:, account_number:, account_number_safe:, routing_number:, check_number:, remitter_name:, memo_field:) ⇒ PaperItem
constructor
A new instance of PaperItem.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_created_at ⇒ Object
- #to_custom_updated_at ⇒ Object
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(id:, object:, live_mode:, created_at:, updated_at:, transaction_line_item_id:, transaction_id:, status:, lockbox_number:, deposit_date:, amount:, currency:, account_number:, account_number_safe:, routing_number:, check_number:, remitter_name:, memo_field:) ⇒ PaperItem
Returns a new instance of PaperItem.
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/modern_treasury/models/paper_item.rb', line 133 def initialize(id:, object:, live_mode:, created_at:, updated_at:, transaction_line_item_id:, transaction_id:, status:, lockbox_number:, deposit_date:, amount:, currency:, account_number:, account_number_safe:, routing_number:, check_number:, remitter_name:, memo_field:) @id = id @object = object @live_mode = live_mode @created_at = created_at @updated_at = updated_at @transaction_line_item_id = transaction_line_item_id @transaction_id = transaction_id @status = status @lockbox_number = lockbox_number @deposit_date = deposit_date @amount = amount @currency = currency @account_number = account_number @account_number_safe = account_number_safe @routing_number = routing_number @check_number = check_number @remitter_name = remitter_name @memo_field = memo_field end |
Instance Attribute Details
#account_number ⇒ String
The account number on the paper item.
68 69 70 |
# File 'lib/modern_treasury/models/paper_item.rb', line 68 def account_number @account_number end |
#account_number_safe ⇒ String
The last 4 digits of the account_number.
72 73 74 |
# File 'lib/modern_treasury/models/paper_item.rb', line 72 def account_number_safe @account_number_safe end |
#amount ⇒ Integer
The amount of the paper item.
60 61 62 |
# File 'lib/modern_treasury/models/paper_item.rb', line 60 def amount @amount end |
#check_number ⇒ String
The check number on the paper item.
80 81 82 |
# File 'lib/modern_treasury/models/paper_item.rb', line 80 def check_number @check_number end |
#created_at ⇒ DateTime
This field will be true if this object exists in the live environment or false if it exists in the test environment.
29 30 31 |
# File 'lib/modern_treasury/models/paper_item.rb', line 29 def created_at @created_at end |
#currency ⇒ Currency
Three-letter ISO currency code.
64 65 66 |
# File 'lib/modern_treasury/models/paper_item.rb', line 64 def currency @currency end |
#deposit_date ⇒ Date
The date the paper item was deposited into your organization’s bank account.
56 57 58 |
# File 'lib/modern_treasury/models/paper_item.rb', line 56 def deposit_date @deposit_date end |
#id ⇒ UUID | String
TODO: Write general description for this method
15 16 17 |
# File 'lib/modern_treasury/models/paper_item.rb', line 15 def id @id end |
#live_mode ⇒ TrueClass | FalseClass
This field will be true if this object exists in the live environment or false if it exists in the test environment.
24 25 26 |
# File 'lib/modern_treasury/models/paper_item.rb', line 24 def live_mode @live_mode end |
#lockbox_number ⇒ String
The identifier for the lockbox assigned by the bank.
51 52 53 |
# File 'lib/modern_treasury/models/paper_item.rb', line 51 def lockbox_number @lockbox_number end |
#memo_field ⇒ String
The memo field on the paper item.
88 89 90 |
# File 'lib/modern_treasury/models/paper_item.rb', line 88 def memo_field @memo_field end |
#object ⇒ String
TODO: Write general description for this method
19 20 21 |
# File 'lib/modern_treasury/models/paper_item.rb', line 19 def object @object end |
#remitter_name ⇒ String
The name of the remitter on the paper item.
84 85 86 |
# File 'lib/modern_treasury/models/paper_item.rb', line 84 def remitter_name @remitter_name end |
#routing_number ⇒ String
The routing number on the paper item.
76 77 78 |
# File 'lib/modern_treasury/models/paper_item.rb', line 76 def routing_number @routing_number end |
#status ⇒ Status16
The current status of the paper item. One of ‘pending`, `completed`, or `returned`.
47 48 49 |
# File 'lib/modern_treasury/models/paper_item.rb', line 47 def status @status end |
#transaction_id ⇒ UUID | String
The ID of the reconciled Transaction or ‘null`.
42 43 44 |
# File 'lib/modern_treasury/models/paper_item.rb', line 42 def transaction_id @transaction_id end |
#transaction_line_item_id ⇒ UUID | String
The ID of the reconciled Transaction Line Item or ‘null`.
38 39 40 |
# File 'lib/modern_treasury/models/paper_item.rb', line 38 def transaction_line_item_id @transaction_line_item_id end |
#updated_at ⇒ DateTime
This field will be true if this object exists in the live environment or false if it exists in the test environment.
34 35 36 |
# File 'lib/modern_treasury/models/paper_item.rb', line 34 def updated_at @updated_at end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/modern_treasury/models/paper_item.rb', line 159 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : nil object = hash.key?('object') ? hash['object'] : nil live_mode = hash.key?('live_mode') ? hash['live_mode'] : nil created_at = if hash.key?('created_at') (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at']) end updated_at = if hash.key?('updated_at') (DateTimeHelper.from_rfc3339(hash['updated_at']) if hash['updated_at']) end transaction_line_item_id = hash.key?('transaction_line_item_id') ? hash['transaction_line_item_id'] : nil transaction_id = hash.key?('transaction_id') ? hash['transaction_id'] : nil status = hash.key?('status') ? hash['status'] : nil lockbox_number = hash.key?('lockbox_number') ? hash['lockbox_number'] : nil deposit_date = hash.key?('deposit_date') ? hash['deposit_date'] : nil amount = hash.key?('amount') ? hash['amount'] : nil currency = hash.key?('currency') ? hash['currency'] : nil account_number = hash.key?('account_number') ? hash['account_number'] : nil account_number_safe = hash.key?('account_number_safe') ? hash['account_number_safe'] : nil routing_number = hash.key?('routing_number') ? hash['routing_number'] : nil check_number = hash.key?('check_number') ? hash['check_number'] : nil remitter_name = hash.key?('remitter_name') ? hash['remitter_name'] : nil memo_field = hash.key?('memo_field') ? hash['memo_field'] : nil # Create object from extracted values. PaperItem.new(id: id, object: object, live_mode: live_mode, created_at: created_at, updated_at: updated_at, transaction_line_item_id: transaction_line_item_id, transaction_id: transaction_id, status: status, lockbox_number: lockbox_number, deposit_date: deposit_date, amount: amount, currency: currency, account_number: account_number, account_number_safe: account_number_safe, routing_number: routing_number, check_number: check_number, remitter_name: remitter_name, memo_field: memo_field) end |
.names ⇒ Object
A mapping from model property names to API property names.
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/modern_treasury/models/paper_item.rb', line 91 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['object'] = 'object' @_hash['live_mode'] = 'live_mode' @_hash['created_at'] = 'created_at' @_hash['updated_at'] = 'updated_at' @_hash['transaction_line_item_id'] = 'transaction_line_item_id' @_hash['transaction_id'] = 'transaction_id' @_hash['status'] = 'status' @_hash['lockbox_number'] = 'lockbox_number' @_hash['deposit_date'] = 'deposit_date' @_hash['amount'] = 'amount' @_hash['currency'] = 'currency' @_hash['account_number'] = 'account_number' @_hash['account_number_safe'] = 'account_number_safe' @_hash['routing_number'] = 'routing_number' @_hash['check_number'] = 'check_number' @_hash['remitter_name'] = 'remitter_name' @_hash['memo_field'] = 'memo_field' @_hash end |
.nullables ⇒ Object
An array for nullable fields
120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/modern_treasury/models/paper_item.rb', line 120 def self.nullables %w[ transaction_line_item_id transaction_id account_number account_number_safe routing_number check_number remitter_name memo_field ] end |
.optionals ⇒ Object
An array for optional fields
115 116 117 |
# File 'lib/modern_treasury/models/paper_item.rb', line 115 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
234 235 236 237 238 239 240 241 242 243 244 245 |
# File 'lib/modern_treasury/models/paper_item.rb', line 234 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, object: #{@object.inspect}, live_mode:"\ " #{@live_mode.inspect}, created_at: #{@created_at.inspect}, updated_at:"\ " #{@updated_at.inspect}, transaction_line_item_id: #{@transaction_line_item_id.inspect},"\ " transaction_id: #{@transaction_id.inspect}, status: #{@status.inspect}, lockbox_number:"\ " #{@lockbox_number.inspect}, deposit_date: #{@deposit_date.inspect}, amount:"\ " #{@amount.inspect}, currency: #{@currency.inspect}, account_number:"\ " #{@account_number.inspect}, account_number_safe: #{@account_number_safe.inspect},"\ " routing_number: #{@routing_number.inspect}, check_number: #{@check_number.inspect},"\ " remitter_name: #{@remitter_name.inspect}, memo_field: #{@memo_field.inspect}>" end |
#to_custom_created_at ⇒ Object
213 214 215 |
# File 'lib/modern_treasury/models/paper_item.rb', line 213 def to_custom_created_at DateTimeHelper.to_rfc3339(created_at) end |
#to_custom_updated_at ⇒ Object
217 218 219 |
# File 'lib/modern_treasury/models/paper_item.rb', line 217 def to_custom_updated_at DateTimeHelper.to_rfc3339(updated_at) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
222 223 224 225 226 227 228 229 230 231 |
# File 'lib/modern_treasury/models/paper_item.rb', line 222 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, object: #{@object}, live_mode: #{@live_mode}, created_at:"\ " #{@created_at}, updated_at: #{@updated_at}, transaction_line_item_id:"\ " #{@transaction_line_item_id}, transaction_id: #{@transaction_id}, status: #{@status},"\ " lockbox_number: #{@lockbox_number}, deposit_date: #{@deposit_date}, amount: #{@amount},"\ " currency: #{@currency}, account_number: #{@account_number}, account_number_safe:"\ " #{@account_number_safe}, routing_number: #{@routing_number}, check_number:"\ " #{@check_number}, remitter_name: #{@remitter_name}, memo_field: #{@memo_field}>" end |