module ConferenceTracker class Duration SECS_IN_MIN = 60 UNITS = { "lightning" => 5 } def initialize(value) @value = UNITS.fetch(value, value).to_i end def to_i @value * SECS_IN_MIN end def to_s UNITS.invert.fetch(@value, "#{@value}min") end end end