Class: Igniter::LedgerClient::Results::ReplayResult
- Inherits:
-
Object
- Object
- Igniter::LedgerClient::Results::ReplayResult
- Includes:
- HashAccess
- Defined in:
- lib/igniter/ledger_client/results.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#facts ⇒ Object
readonly
Returns the value of attribute facts.
Instance Method Summary collapse
-
#initialize(raw = {}) ⇒ ReplayResult
constructor
A new instance of ReplayResult.
- #to_h ⇒ Object
Methods included from HashAccess
Constructor Details
#initialize(raw = {}) ⇒ ReplayResult
Returns a new instance of ReplayResult.
207 208 209 210 211 212 |
# File 'lib/igniter/ledger_client/results.rb', line 207 def initialize(raw = {}) data = normalize(raw) @facts = Array(data[:facts]).freeze @count = data.key?(:count) ? data[:count].to_i : facts.size freeze end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
205 206 207 |
# File 'lib/igniter/ledger_client/results.rb', line 205 def count @count end |
#facts ⇒ Object (readonly)
Returns the value of attribute facts.
205 206 207 |
# File 'lib/igniter/ledger_client/results.rb', line 205 def facts @facts end |
Instance Method Details
#to_h ⇒ Object
214 215 216 |
# File 'lib/igniter/ledger_client/results.rb', line 214 def to_h { facts: facts, count: count } end |