Class: Cldr::Export::Data::Lists
- Defined in:
- lib/cldr/export/data/lists.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(locale) ⇒ Lists
constructor
A new instance of Lists.
- #lists ⇒ Object
Methods inherited from Base
Methods inherited from Hash
#deep_merge, #deep_stringify_keys, #symbolize_keys
Constructor Details
#initialize(locale) ⇒ Lists
Returns a new instance of Lists.
5 6 7 8 |
# File 'lib/cldr/export/data/lists.rb', line 5 def initialize(locale) super update(:lists => lists) end |
Instance Method Details
#lists ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/cldr/export/data/lists.rb', line 10 def lists select('listPatterns/listPattern').inject({}) do |list_pattern_ret, list_pattern| pattern_type = if attribute = list_pattern.attribute('type') attribute.value.to_sym else :default end list_pattern_ret[pattern_type] = select(list_pattern, 'listPatternPart').inject({}) do |part_ret, part| part_ret[part.attribute('type').value.to_sym] = part.content part_ret end list_pattern_ret end end |