Class: Igniter::LedgerClient::Results::FactRefResult
- Inherits:
-
Object
- Object
- Igniter::LedgerClient::Results::FactRefResult
- Includes:
- HashAccess
- Defined in:
- lib/igniter/ledger_client/results.rb
Instance Attribute Summary collapse
-
#ref ⇒ Object
readonly
Returns the value of attribute ref.
Instance Method Summary collapse
- #found? ⇒ Boolean
-
#initialize(raw = {}) ⇒ FactRefResult
constructor
A new instance of FactRefResult.
- #to_h ⇒ Object
Methods included from HashAccess
Constructor Details
#initialize(raw = {}) ⇒ FactRefResult
Returns a new instance of FactRefResult.
292 293 294 295 296 297 298 299 300 301 |
# File 'lib/igniter/ledger_client/results.rb', line 292 def initialize(raw = {}) data = normalize_hash(raw) @ref = data[:ref] ? normalize_hash(data[:ref]).freeze : nil @found = if data.key?(:found) data[:found] ? true : false else !ref.nil? end freeze end |
Instance Attribute Details
#ref ⇒ Object (readonly)
Returns the value of attribute ref.
290 291 292 |
# File 'lib/igniter/ledger_client/results.rb', line 290 def ref @ref end |
Instance Method Details
#found? ⇒ Boolean
303 |
# File 'lib/igniter/ledger_client/results.rb', line 303 def found? = @found |
#to_h ⇒ Object
305 306 307 |
# File 'lib/igniter/ledger_client/results.rb', line 305 def to_h { found: found?, ref: ref } end |