Class: Igniter::LedgerClient::Results::ReadResult
- Inherits:
-
Object
- Object
- Igniter::LedgerClient::Results::ReadResult
- Includes:
- HashAccess
- Defined in:
- lib/igniter/ledger_client/results.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #found? ⇒ Boolean
-
#initialize(raw = {}) ⇒ ReadResult
constructor
A new instance of ReadResult.
- #to_h ⇒ Object
Methods included from HashAccess
Constructor Details
#initialize(raw = {}) ⇒ ReadResult
Returns a new instance of ReadResult.
99 100 101 102 103 104 |
# File 'lib/igniter/ledger_client/results.rb', line 99 def initialize(raw = {}) data = normalize(raw) @value = data[:value] @found = data.key?(:found) ? boolean(data[:found]) : !value.nil? freeze end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
97 98 99 |
# File 'lib/igniter/ledger_client/results.rb', line 97 def value @value end |
Instance Method Details
#found? ⇒ Boolean
106 |
# File 'lib/igniter/ledger_client/results.rb', line 106 def found? = @found |
#to_h ⇒ Object
108 109 110 |
# File 'lib/igniter/ledger_client/results.rb', line 108 def to_h { value: value, found: found? } end |