Class: TwitterCldr::Formatters::TimeFormatter

Inherits:
DateTimeFormatter show all
Defined in:
lib/twitter_cldr/formatters/calendars/time_formatter.rb

Constant Summary

Constants inherited from DateTimeFormatter

DateTimeFormatter::METHODS, DateTimeFormatter::WEEKDAY_KEYS

Instance Attribute Summary

Attributes inherited from Base

#tokenizer

Instance Method Summary collapse

Methods inherited from DateTimeFormatter

#additional_format_selector, additional_formats_for, #result_for_token

Methods inherited from Base

#format

Constructor Details

#initialize(options = {}) ⇒ TimeFormatter

Returns a new instance of TimeFormatter.



9
10
11
12
13
14
15
16
# File 'lib/twitter_cldr/formatters/calendars/time_formatter.rb', line 9

def initialize(options = {})
  locale = extract_locale(options)
  cache_key = TwitterCldr::Utils.compute_cache_key("time", locale, options[:calendar_type])
  @tokenizer = tokenizer_cache[cache_key] ||= TwitterCldr::Tokenizers::TimeTokenizer.new(
    :locale => locale,
    :calendar_type => options[:calendar_type]
  )
end