Class: Informed::Informant::DoneMessage
- Defined in:
- lib/informed.rb
Overview
Message that’s logged when an informed upon method is completed
Instance Attribute Summary collapse
-
#result ⇒ Object
Returns the value of attribute result.
Attributes inherited from Message
#also_log, #informee, #keyword_arguments, #method
Instance Method Summary collapse
-
#initialize(result:, **kwargs) ⇒ DoneMessage
constructor
A new instance of DoneMessage.
-
#to_h ⇒ Hash
A Hash with ‘status: :done` and the result of #message.
Constructor Details
#initialize(result:, **kwargs) ⇒ DoneMessage
Returns a new instance of DoneMessage.
224 225 226 227 |
# File 'lib/informed.rb', line 224 def initialize(result:, **kwargs) super(**kwargs) self.result = result end |
Instance Attribute Details
#result ⇒ Object
Returns the value of attribute result.
219 220 221 |
# File 'lib/informed.rb', line 219 def result @result end |
Instance Method Details
#to_h ⇒ Hash
Returns a Hash with ‘status: :done` and the result of Informed::Informant#message.
230 231 232 233 234 |
# File 'lib/informed.rb', line 230 def to_h = { status: :done } [:result] = result if also_log[:result] super.merge() end |