Sha256: 456b3a2d22651367fced14735e926cccb859d2579b72d864f445002314b5a6cc

Contents?: true

Size: 498 Bytes

Versions: 3

Compression:

Stored size: 498 Bytes

Contents

# encoding: UTF-8

# Copyright 2012 Twitter, Inc
# http://www.apache.org/licenses/LICENSE-2.0

module TwitterCldr
  class LocalizedTimespan < LocalizedObject

    def initialize(seconds, locale)
      @formatter = TwitterCldr::Formatters::TimespanFormatter.new(:locale => locale)
      @seconds = seconds
    end

    def to_s(unit = :default)
      @formatter.format(@seconds, unit)
    end

    protected

    def formatter_const
      TwitterCldr::Formatters::TimespanFormatter
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
twitter_cldr-1.5.0 lib/twitter_cldr/core_ext/calendars/timespan.rb
twitter_cldr-1.4.1 lib/twitter_cldr/core_ext/calendars/timespan.rb
twitter_cldr-1.4.0 lib/twitter_cldr/core_ext/calendars/timespan.rb