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.8.1 lib/infobar/duration.rb
infobar-0.8.0 lib/infobar/duration.rb
infobar-0.7.4 lib/infobar/duration.rb
infobar-0.7.2 lib/infobar/duration.rb
infobar-0.7.1 lib/infobar/duration.rb
infobar-0.7.0 lib/infobar/duration.rb
infobar-0.6.2 lib/infobar/duration.rb
infobar-0.6.1 lib/infobar/duration.rb
infobar-0.6.0 lib/infobar/duration.rb
infobar-0.5.1 lib/infobar/duration.rb
infobar-0.5.0 lib/infobar/duration.rb
infobar-0.4.0 lib/infobar/duration.rb
infobar-0.3.0 lib/infobar/duration.rb
infobar-0.2.0 lib/infobar/duration.rb
infobar-0.1.1 lib/infobar/duration.rb
infobar-0.1.0 lib/infobar/duration.rb
infobar-0.0.7 lib/infobar/duration.rb
infobar-0.0.6 lib/infobar/duration.rb
infobar-0.0.5 lib/infobar/duration.rb
infobar-0.0.4 lib/infobar/duration.rb