Class: Datasets::CLDRPlurals
- Defined in:
- lib/datasets/cldr-plurals.rb
Defined Under Namespace
Instance Attribute Summary
Attributes inherited from Dataset
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize ⇒ CLDRPlurals
constructor
A new instance of CLDRPlurals.
Methods inherited from Dataset
Constructor Details
#initialize ⇒ CLDRPlurals
Returns a new instance of CLDRPlurals.
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/datasets/cldr-plurals.rb', line 18 def initialize super() @metadata.id = "cldr-plurals" @metadata.name = "CLDR language plural rules" @metadata.url = "https://raw.githubusercontent.com/unicode-org/cldr/master/common/supplemental/plurals.xml" @metadata.licenses = ["Unicode-DFS-2016"] @metadata.description = <<~DESCRIPTION Language plural rules in Unicode Common Locale Data Repository. See also: https://unicode-org.github.io/cldr-staging/charts/latest/supplemental/language_plural_rules.html DESCRIPTION end |
Instance Method Details
#each(&block) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/datasets/cldr-plurals.rb', line 30 def each(&block) return to_enum(__method__) unless block_given? open_data do |input| catch do |abort_tag| listener = Listener.new(abort_tag, &block) parser = REXML::Parsers::StreamParser.new(input, listener) parser.parse end end end |