Class: ModernTreasury::LedgerAccountStatement
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ModernTreasury::LedgerAccountStatement
- Defined in:
- lib/modern_treasury/models/ledger_account_statement.rb
Overview
LedgerAccountStatement Model.
Instance Attribute Summary collapse
-
#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.
-
#description ⇒ String
The description of the ledger account statement.
-
#effective_at_lower_bound ⇒ DateTime
The inclusive lower bound of the effective_at timestamp of the ledger entries to be included in the ledger account statement.
-
#effective_at_upper_bound ⇒ DateTime
The exclusive upper bound of the effective_at timestamp of the ledger entries to be included in the ledger account statement.
-
#ending_balance ⇒ LedgerBalances
The exclusive upper bound of the effective_at timestamp of the ledger entries to be included in the ledger account statement.
-
#id ⇒ UUID | String
TODO: Write general description for this method.
-
#ledger_account_id ⇒ UUID | String
The id of the ledger account whose ledger entries are queried against, and its balances are computed as a result.
-
#ledger_account_lock_version ⇒ Integer
Lock version of the ledger account at the time of statement generation.
-
#ledger_account_normal_balance ⇒ LedgerAccountNormalBalance
The normal balance of the ledger account.
-
#ledger_id ⇒ UUID | String
The id of the ledger that this ledger account statement belongs to.
-
#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.
-
#metadata ⇒ Hash[String, String]
Additional data represented as key-value pairs.
-
#object ⇒ String
TODO: Write general description for this method.
-
#starting_balance ⇒ LedgerBalances
The exclusive upper bound of the effective_at timestamp of the ledger entries to be included in the ledger account statement.
-
#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:, ledger_id:, description:, ledger_account_id:, ledger_account_lock_version:, ledger_account_normal_balance:, effective_at_lower_bound:, effective_at_upper_bound:, starting_balance:, ending_balance:, metadata:) ⇒ LedgerAccountStatement
constructor
A new instance of LedgerAccountStatement.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_created_at ⇒ Object
- #to_custom_effective_at_lower_bound ⇒ Object
- #to_custom_effective_at_upper_bound ⇒ 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:, ledger_id:, description:, ledger_account_id:, ledger_account_lock_version:, ledger_account_normal_balance:, effective_at_lower_bound:, effective_at_upper_bound:, starting_balance:, ending_balance:, metadata:) ⇒ LedgerAccountStatement
Returns a new instance of LedgerAccountStatement.
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/modern_treasury/models/ledger_account_statement.rb', line 116 def initialize(id:, object:, live_mode:, created_at:, updated_at:, ledger_id:, description:, ledger_account_id:, ledger_account_lock_version:, ledger_account_normal_balance:, effective_at_lower_bound:, effective_at_upper_bound:, starting_balance:, ending_balance:, metadata:) @id = id @object = object @live_mode = live_mode @created_at = created_at @updated_at = updated_at @ledger_id = ledger_id @description = description @ledger_account_id = ledger_account_id @ledger_account_lock_version = ledger_account_lock_version @ledger_account_normal_balance = ledger_account_normal_balance @effective_at_lower_bound = effective_at_lower_bound @effective_at_upper_bound = effective_at_upper_bound @starting_balance = starting_balance @ending_balance = ending_balance @metadata = end |
Instance Attribute Details
#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/ledger_account_statement.rb', line 29 def created_at @created_at end |
#description ⇒ String
The description of the ledger account statement.
42 43 44 |
# File 'lib/modern_treasury/models/ledger_account_statement.rb', line 42 def description @description end |
#effective_at_lower_bound ⇒ DateTime
The inclusive lower bound of the effective_at timestamp of the ledger entries to be included in the ledger account statement.
60 61 62 |
# File 'lib/modern_treasury/models/ledger_account_statement.rb', line 60 def effective_at_lower_bound @effective_at_lower_bound end |
#effective_at_upper_bound ⇒ DateTime
The exclusive upper bound of the effective_at timestamp of the ledger entries to be included in the ledger account statement.
65 66 67 |
# File 'lib/modern_treasury/models/ledger_account_statement.rb', line 65 def effective_at_upper_bound @effective_at_upper_bound end |
#ending_balance ⇒ LedgerBalances
The exclusive upper bound of the effective_at timestamp of the ledger entries to be included in the ledger account statement.
75 76 77 |
# File 'lib/modern_treasury/models/ledger_account_statement.rb', line 75 def ending_balance @ending_balance end |
#id ⇒ UUID | String
TODO: Write general description for this method
15 16 17 |
# File 'lib/modern_treasury/models/ledger_account_statement.rb', line 15 def id @id end |
#ledger_account_id ⇒ UUID | String
The id of the ledger account whose ledger entries are queried against, and its balances are computed as a result.
47 48 49 |
# File 'lib/modern_treasury/models/ledger_account_statement.rb', line 47 def ledger_account_id @ledger_account_id end |
#ledger_account_lock_version ⇒ Integer
Lock version of the ledger account at the time of statement generation.
51 52 53 |
# File 'lib/modern_treasury/models/ledger_account_statement.rb', line 51 def ledger_account_lock_version @ledger_account_lock_version end |
#ledger_account_normal_balance ⇒ LedgerAccountNormalBalance
The normal balance of the ledger account.
55 56 57 |
# File 'lib/modern_treasury/models/ledger_account_statement.rb', line 55 def ledger_account_normal_balance @ledger_account_normal_balance end |
#ledger_id ⇒ UUID | String
The id of the ledger that this ledger account statement belongs to.
38 39 40 |
# File 'lib/modern_treasury/models/ledger_account_statement.rb', line 38 def ledger_id @ledger_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/ledger_account_statement.rb', line 24 def live_mode @live_mode end |
#metadata ⇒ Hash[String, String]
Additional data represented as key-value pairs. Both the key and value must be strings.
80 81 82 |
# File 'lib/modern_treasury/models/ledger_account_statement.rb', line 80 def @metadata end |
#object ⇒ String
TODO: Write general description for this method
19 20 21 |
# File 'lib/modern_treasury/models/ledger_account_statement.rb', line 19 def object @object end |
#starting_balance ⇒ LedgerBalances
The exclusive upper bound of the effective_at timestamp of the ledger entries to be included in the ledger account statement.
70 71 72 |
# File 'lib/modern_treasury/models/ledger_account_statement.rb', line 70 def starting_balance @starting_balance 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/ledger_account_statement.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.
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 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 |
# File 'lib/modern_treasury/models/ledger_account_statement.rb', line 139 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 ledger_id = hash.key?('ledger_id') ? hash['ledger_id'] : nil description = hash.key?('description') ? hash['description'] : nil ledger_account_id = hash.key?('ledger_account_id') ? hash['ledger_account_id'] : nil ledger_account_lock_version = hash.key?('ledger_account_lock_version') ? hash['ledger_account_lock_version'] : nil ledger_account_normal_balance = hash.key?('ledger_account_normal_balance') ? hash['ledger_account_normal_balance'] : nil effective_at_lower_bound = if hash.key?('effective_at_lower_bound') (DateTimeHelper.from_rfc3339(hash['effective_at_lower_bound']) if hash['effective_at_lower_bound']) end effective_at_upper_bound = if hash.key?('effective_at_upper_bound') (DateTimeHelper.from_rfc3339(hash['effective_at_upper_bound']) if hash['effective_at_upper_bound']) end starting_balance = LedgerBalances.from_hash(hash['starting_balance']) if hash['starting_balance'] ending_balance = LedgerBalances.from_hash(hash['ending_balance']) if hash['ending_balance'] = hash.key?('metadata') ? hash['metadata'] : nil # Create object from extracted values. LedgerAccountStatement.new(id: id, object: object, live_mode: live_mode, created_at: created_at, updated_at: updated_at, ledger_id: ledger_id, description: description, ledger_account_id: ledger_account_id, ledger_account_lock_version: ledger_account_lock_version, ledger_account_normal_balance: ledger_account_normal_balance, effective_at_lower_bound: effective_at_lower_bound, effective_at_upper_bound: effective_at_upper_bound, starting_balance: starting_balance, ending_balance: ending_balance, metadata: ) end |
.names ⇒ Object
A mapping from model property names to API property names.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/modern_treasury/models/ledger_account_statement.rb', line 83 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['ledger_id'] = 'ledger_id' @_hash['description'] = 'description' @_hash['ledger_account_id'] = 'ledger_account_id' @_hash['ledger_account_lock_version'] = 'ledger_account_lock_version' @_hash['ledger_account_normal_balance'] = 'ledger_account_normal_balance' @_hash['effective_at_lower_bound'] = 'effective_at_lower_bound' @_hash['effective_at_upper_bound'] = 'effective_at_upper_bound' @_hash['starting_balance'] = 'starting_balance' @_hash['ending_balance'] = 'ending_balance' @_hash['metadata'] = 'metadata' @_hash end |
.nullables ⇒ Object
An array for nullable fields
110 111 112 113 114 |
# File 'lib/modern_treasury/models/ledger_account_statement.rb', line 110 def self.nullables %w[ description ] end |
.optionals ⇒ Object
An array for optional fields
105 106 107 |
# File 'lib/modern_treasury/models/ledger_account_statement.rb', line 105 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
218 219 220 221 222 223 224 225 226 227 228 229 |
# File 'lib/modern_treasury/models/ledger_account_statement.rb', line 218 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}, ledger_id: #{@ledger_id.inspect}, description:"\ " #{@description.inspect}, ledger_account_id: #{@ledger_account_id.inspect},"\ " ledger_account_lock_version: #{@ledger_account_lock_version.inspect},"\ " ledger_account_normal_balance: #{@ledger_account_normal_balance.inspect},"\ " effective_at_lower_bound: #{@effective_at_lower_bound.inspect}, effective_at_upper_bound:"\ " #{@effective_at_upper_bound.inspect}, starting_balance: #{@starting_balance.inspect},"\ " ending_balance: #{@ending_balance.inspect}, metadata: #{@metadata.inspect}>" end |
#to_custom_created_at ⇒ Object
189 190 191 |
# File 'lib/modern_treasury/models/ledger_account_statement.rb', line 189 def to_custom_created_at DateTimeHelper.to_rfc3339(created_at) end |
#to_custom_effective_at_lower_bound ⇒ Object
197 198 199 |
# File 'lib/modern_treasury/models/ledger_account_statement.rb', line 197 def to_custom_effective_at_lower_bound DateTimeHelper.to_rfc3339(effective_at_lower_bound) end |
#to_custom_effective_at_upper_bound ⇒ Object
201 202 203 |
# File 'lib/modern_treasury/models/ledger_account_statement.rb', line 201 def to_custom_effective_at_upper_bound DateTimeHelper.to_rfc3339(effective_at_upper_bound) end |
#to_custom_updated_at ⇒ Object
193 194 195 |
# File 'lib/modern_treasury/models/ledger_account_statement.rb', line 193 def to_custom_updated_at DateTimeHelper.to_rfc3339(updated_at) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
206 207 208 209 210 211 212 213 214 215 |
# File 'lib/modern_treasury/models/ledger_account_statement.rb', line 206 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}, ledger_id: #{@ledger_id}, description:"\ " #{@description}, ledger_account_id: #{@ledger_account_id}, ledger_account_lock_version:"\ " #{@ledger_account_lock_version}, ledger_account_normal_balance:"\ " #{@ledger_account_normal_balance}, effective_at_lower_bound: #{@effective_at_lower_bound},"\ " effective_at_upper_bound: #{@effective_at_upper_bound}, starting_balance:"\ " #{@starting_balance}, ending_balance: #{@ending_balance}, metadata: #{@metadata}>" end |