Class: Igniter::LedgerClient::Results::ReplayResult

Inherits:
Object
  • Object
show all
Includes:
HashAccess
Defined in:
lib/igniter/ledger_client/results.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#countObject (readonly)

Returns the value of attribute count.



205
206
207
# File 'lib/igniter/ledger_client/results.rb', line 205

def count
  @count
end

#factsObject (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_hObject



214
215
216
# File 'lib/igniter/ledger_client/results.rb', line 214

def to_h
  { facts: facts, count: count }
end