Sha256: 748e95e7c2f3c93fd256eedcf322d463d1a21fc3dbc18ac7a8c53de42a411d04

Contents?: true

Size: 247 Bytes

Versions: 24

Compression:

Stored size: 247 Bytes

Contents

class Infobar::Duration
  def initialize(value, format: nil)
    duration = Tins::Duration.new(value)
    @string =
      if format
        duration.format(format)
      else
        duration
      end.to_s
  end

  def to_s
    @string
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
infobar-0.0.3 lib/infobar/duration.rb
infobar-0.0.2 lib/infobar/duration.rb
infobar-0.0.1 lib/infobar/duration.rb
infobar-0.0.0 lib/infobar/duration.rb