Skip to content

Commit

Permalink
Merge pull request #27 from camertron/full_list_support
Browse files Browse the repository at this point in the history
Full list support
  • Loading branch information
tigrish committed Jan 18, 2014
2 parents 13f1e39 + ceccfb4 commit 34d5c6d
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/cldr/export/data/lists.rb
Expand Up @@ -8,9 +8,18 @@ def initialize(locale)
end

def lists
select('listPatterns/listPattern/listPatternPart').inject({}) do |result, node|
result[node.attribute('type').value.to_sym] = node.content
result
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
end
Expand Down

0 comments on commit 34d5c6d

Please sign in to comment.