class Informed::Informant::DoneMessage

Message that's logged when an informed upon method is completed

Attributes

result[RW]

Public Class Methods

new(result:, **kwargs) click to toggle source

@param result [Object] Result of the called method. may be logged if

{#also_log} has `result: true`

@see Message#initialize

Calls superclass method Informed::Informant::Message::new
# File lib/informed.rb, line 224
def initialize(result:, **kwargs)
  super(**kwargs)
  self.result = result
end

Public Instance Methods

to_h() click to toggle source

@return [Hash] a Hash with `status: :done` and the result of {#message}

Calls superclass method Informed::Informant::Message#to_h
# File lib/informed.rb, line 230
def to_h
  done_message = { status: :done }
  done_message[:result] = result if also_log[:result]
  super.merge(done_message)
end