class Lumberjack::EcsDevice::DurationFormatter
Public Class Methods
new(multiplier)
click to toggle source
# File lib/lumberjack_ecs_device.rb, line 117 def initialize(multiplier) @multiplier = multiplier end
Public Instance Methods
call(value)
click to toggle source
# File lib/lumberjack_ecs_device.rb, line 121 def call(value) if value.is_a?(Numeric) value = (value.to_f * @multiplier).round end {"event" => {"duration" => value}} end