Class: Igniter::LedgerClient::Results::ChangeEventResult
- Inherits:
-
Object
- Object
- Igniter::LedgerClient::Results::ChangeEventResult
- Includes:
- HashAccess
- Defined in:
- lib/igniter/ledger_client/results.rb
Instance Attribute Summary collapse
-
#cursor ⇒ Object
readonly
Returns the value of attribute cursor.
-
#fact_id ⇒ Object
readonly
Returns the value of attribute fact_id.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#sequence ⇒ Object
readonly
Returns the value of attribute sequence.
-
#store ⇒ Object
readonly
Returns the value of attribute store.
-
#value_hash ⇒ Object
readonly
Returns the value of attribute value_hash.
Instance Method Summary collapse
-
#initialize(raw = {}) ⇒ ChangeEventResult
constructor
A new instance of ChangeEventResult.
- #to_h ⇒ Object
Methods included from HashAccess
Constructor Details
#initialize(raw = {}) ⇒ ChangeEventResult
Returns a new instance of ChangeEventResult.
321 322 323 324 325 326 327 328 329 330 331 |
# File 'lib/igniter/ledger_client/results.rb', line 321 def initialize(raw = {}) @raw = raw data = normalize(raw) @cursor = normalize_cursor(data[:cursor]) @sequence = (data[:sequence] || cursor[:sequence])&.to_i @store = token(data[:store]) @key = data[:key] @fact_id = data[:fact_id] @value_hash = data[:value_hash] || fact_value_hash(raw) freeze end |
Instance Attribute Details
#cursor ⇒ Object (readonly)
Returns the value of attribute cursor.
319 320 321 |
# File 'lib/igniter/ledger_client/results.rb', line 319 def cursor @cursor end |
#fact_id ⇒ Object (readonly)
Returns the value of attribute fact_id.
319 320 321 |
# File 'lib/igniter/ledger_client/results.rb', line 319 def fact_id @fact_id end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
319 320 321 |
# File 'lib/igniter/ledger_client/results.rb', line 319 def key @key end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
319 320 321 |
# File 'lib/igniter/ledger_client/results.rb', line 319 def raw @raw end |
#sequence ⇒ Object (readonly)
Returns the value of attribute sequence.
319 320 321 |
# File 'lib/igniter/ledger_client/results.rb', line 319 def sequence @sequence end |
#store ⇒ Object (readonly)
Returns the value of attribute store.
319 320 321 |
# File 'lib/igniter/ledger_client/results.rb', line 319 def store @store end |
#value_hash ⇒ Object (readonly)
Returns the value of attribute value_hash.
319 320 321 |
# File 'lib/igniter/ledger_client/results.rb', line 319 def value_hash @value_hash end |
Instance Method Details
#to_h ⇒ Object
333 334 335 336 337 338 339 340 341 342 343 |
# File 'lib/igniter/ledger_client/results.rb', line 333 def to_h { sequence: sequence, store: store, key: key, fact_id: fact_id, value_hash: value_hash, cursor: cursor, raw: raw }.compact end |