Class: TwitterCldr::Resources::GregorianCalendar
- Inherits:
-
Object
- Object
- TwitterCldr::Resources::GregorianCalendar
- Defined in:
- lib/twitter_cldr/resources/calendars_importer.rb
Constant Summary collapse
- ERA_TAGS =
['eraNames', 'eraAbbr', 'eraNarrow'].freeze
Instance Attribute Summary collapse
-
#cldr_req ⇒ Object
readonly
Returns the value of attribute cldr_req.
-
#locale ⇒ Object
readonly
Returns the value of attribute locale.
Instance Method Summary collapse
-
#initialize(locale, cldr_req) ⇒ GregorianCalendar
constructor
A new instance of GregorianCalendar.
- #to_h ⇒ Object
Constructor Details
#initialize(locale, cldr_req) ⇒ GregorianCalendar
Returns a new instance of GregorianCalendar.
68 69 70 71 |
# File 'lib/twitter_cldr/resources/calendars_importer.rb', line 68 def initialize(locale, cldr_req) @locale = locale @cldr_req = cldr_req end |
Instance Attribute Details
#cldr_req ⇒ Object (readonly)
Returns the value of attribute cldr_req.
66 67 68 |
# File 'lib/twitter_cldr/resources/calendars_importer.rb', line 66 def cldr_req @cldr_req end |
#locale ⇒ Object (readonly)
Returns the value of attribute locale.
66 67 68 |
# File 'lib/twitter_cldr/resources/calendars_importer.rb', line 66 def locale @locale end |
Instance Method Details
#to_h ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/twitter_cldr/resources/calendars_importer.rb', line 73 def to_h { calendars: { gregorian: { days: contexts('day'), months: contexts('month'), eras: eras, quarters: contexts('quarter'), periods: contexts('dayPeriod', group: "alt"), fields: fields, formats: { date: formats('date'), time: formats('time'), datetime: formats('dateTime') }, additional_formats: additional_formats } } } end |