Class: Sanford::Worker::SummaryLine
- Inherits:
-
Object
- Object
- Sanford::Worker::SummaryLine
- Defined in:
- lib/sanford/worker.rb
Instance Method Summary collapse
- #add(key, value) ⇒ Object
-
#initialize ⇒ SummaryLine
constructor
A new instance of SummaryLine.
-
#to_s ⇒ Object
change the key’s order in the array to change the order to change the order they appear in when logged.
Constructor Details
#initialize ⇒ SummaryLine
Returns a new instance of SummaryLine.
104 105 106 |
# File 'lib/sanford/worker.rb', line 104 def initialize @hash = {} end |
Instance Method Details
#add(key, value) ⇒ Object
108 109 110 |
# File 'lib/sanford/worker.rb', line 108 def add(key, value) @hash[key] = value.inspect if value end |
#to_s ⇒ Object
change the key’s order in the array to change the order to change the order they appear in when logged
114 115 116 117 118 |
# File 'lib/sanford/worker.rb', line 114 def to_s [ 'version', 'service', 'handler', 'status', 'duration', 'params' ].map do |key| "#{key}=#{@hash[key]}" if @hash[key] end.compact.join(" ") end |