Class: TwitterCldr::Formatters::TimespanFormatter

Inherits:
Formatter
  • Object
show all
Defined in:
lib/twitter_cldr/formatters/calendars/timespan_formatter.rb

Instance Attribute Summary

Attributes inherited from Formatter

#data_reader

Instance Method Summary collapse

Methods inherited from Formatter

#initialize

Constructor Details

This class inherits a constructor from TwitterCldr::Formatters::Formatter

Instance Method Details

#format(tokens, number, options = {}) ⇒ Object



10
11
12
# File 'lib/twitter_cldr/formatters/calendars/timespan_formatter.rb', line 10

def format(tokens, number, options = {})
  tokens.map(&:value).join.gsub(/\{[0-9]\}/, number.abs.to_s)
end