Class: ActiveGenie::Result
- Inherits:
-
Object
- Object
- ActiveGenie::Result
- Defined in:
- lib/active_genie/entities/result.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#reasoning ⇒ Object
readonly
Returns the value of attribute reasoning.
Instance Method Summary collapse
- #explanation ⇒ Object
-
#initialize(data:, metadata:, reasoning: nil) ⇒ Result
constructor
A new instance of Result.
- #to_h ⇒ Object
- #to_json ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(data:, metadata:, reasoning: nil) ⇒ Result
Returns a new instance of Result.
7 8 9 10 11 |
# File 'lib/active_genie/entities/result.rb', line 7 def initialize(data:, metadata:, reasoning: nil) @data = data @reasoning = reasoning @metadata = end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
5 6 7 |
# File 'lib/active_genie/entities/result.rb', line 5 def data @data end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
5 6 7 |
# File 'lib/active_genie/entities/result.rb', line 5 def @metadata end |
#reasoning ⇒ Object (readonly)
Returns the value of attribute reasoning.
5 6 7 |
# File 'lib/active_genie/entities/result.rb', line 5 def reasoning @reasoning end |
Instance Method Details
#explanation ⇒ Object
13 14 15 |
# File 'lib/active_genie/entities/result.rb', line 13 def explanation @reasoning end |
#to_h ⇒ Object
17 18 19 |
# File 'lib/active_genie/entities/result.rb', line 17 def to_h { data: @data, reasoning: @reasoning, metadata: @metadata } end |
#to_json ⇒ Object
25 26 27 |
# File 'lib/active_genie/entities/result.rb', line 25 def to_json(...) to_h.to_json(...) end |
#to_s ⇒ Object
21 22 23 |
# File 'lib/active_genie/entities/result.rb', line 21 def to_s to_h.to_s end |