Class: Infobar::Number
Instance Method Summary collapse
-
#initialize(value, format: nil) ⇒ Number
constructor
A new instance of Number.
- #to_s ⇒ Object
Constructor Details
#initialize(value, format: nil) ⇒ Number
Returns a new instance of Number.
2 3 4 5 |
# File 'lib/infobar/number.rb', line 2 def initialize(value, format: nil) duration = Tins::Duration.new(value) @string = format ? (format % value) : value.to_s end |
Instance Method Details
#to_s ⇒ Object
7 8 9 |
# File 'lib/infobar/number.rb', line 7 def to_s @string end |