Class: Igniter::LedgerClient::Results::CausationChainResult
- Inherits:
-
Object
- Object
- Igniter::LedgerClient::Results::CausationChainResult
- Includes:
- HashAccess
- Defined in:
- lib/igniter/ledger_client/results.rb
Instance Attribute Summary collapse
-
#chain ⇒ Object
readonly
Returns the value of attribute chain.
-
#count ⇒ Object
readonly
Returns the value of attribute count.
Instance Method Summary collapse
-
#initialize(raw = {}) ⇒ CausationChainResult
constructor
A new instance of CausationChainResult.
- #to_h ⇒ Object
Methods included from HashAccess
Constructor Details
#initialize(raw = {}) ⇒ CausationChainResult
Returns a new instance of CausationChainResult.
231 232 233 234 235 236 |
# File 'lib/igniter/ledger_client/results.rb', line 231 def initialize(raw = {}) data = normalize(raw) @chain = Array(data[:chain]).map { |entry| normalize_hash(entry) }.freeze @count = data.key?(:count) ? data[:count].to_i : chain.size freeze end |
Instance Attribute Details
#chain ⇒ Object (readonly)
Returns the value of attribute chain.
229 230 231 |
# File 'lib/igniter/ledger_client/results.rb', line 229 def chain @chain end |
#count ⇒ Object (readonly)
Returns the value of attribute count.
229 230 231 |
# File 'lib/igniter/ledger_client/results.rb', line 229 def count @count end |
Instance Method Details
#to_h ⇒ Object
238 239 240 |
# File 'lib/igniter/ledger_client/results.rb', line 238 def to_h { chain: chain, count: count } end |