Class: Totalizer::ActivationMessage

Inherits:
Message
  • Object
show all
Defined in:
lib/totalizer/message.rb

Instance Attribute Summary

Attributes inherited from Message

#description, #duration, #text

Instance Method Summary collapse

Methods inherited from Message

#percentage_string, #period_string

Constructor Details

#initialize(step, duration) ⇒ ActivationMessage

Returns a new instance of ActivationMessage.



40
41
42
43
44
# File 'lib/totalizer/message.rb', line 40

def initialize step, duration
  self.duration = duration
  self.text = "#{period_string}: #{step.start} → #{step.finish} (#{percentage_string(step.rate)})"
  self.description = "Created this period and did key activity"
end