Class: ICU4X::PluralRules
- Inherits:
-
Object
- Object
- ICU4X::PluralRules
- Defined in:
- lib/icu4x/yard_docs.rb
Overview
Provides locale-aware plural rules for cardinal and ordinal numbers.
PluralRules determines the appropriate plural category for a given number based on the locale’s pluralization rules.
Instance Method Summary collapse
-
#categories ⇒ Array<Symbol>
Returns all plural categories available for this locale.
-
#initialize(locale, provider: nil, type: :cardinal) ⇒ PluralRules
constructor
Creates a new PluralRules instance.
-
#resolved_options ⇒ Hash
Returns the resolved options for this instance.
-
#select(number) ⇒ Symbol
Selects the plural category for a number.
-
#select_range(start_value, end_value) ⇒ Symbol
Selects the plural category for a range of numbers.
Constructor Details
#initialize(locale, provider: nil, type: :cardinal) ⇒ PluralRules
Creates a new PluralRules instance.
371 |
# File 'lib/icu4x/yard_docs.rb', line 371 def initialize(locale, provider: nil, type: :cardinal); end |
Instance Method Details
#categories ⇒ Array<Symbol>
Returns all plural categories available for this locale.
414 |
# File 'lib/icu4x/yard_docs.rb', line 414 def categories; end |
#resolved_options ⇒ Hash
Returns the resolved options for this instance.
422 |
# File 'lib/icu4x/yard_docs.rb', line 422 def ; end |
#select(number) ⇒ Symbol
Selects the plural category for a number.
384 |
# File 'lib/icu4x/yard_docs.rb', line 384 def select(number); end |
#select_range(start_value, end_value) ⇒ Symbol
Selects the plural category for a range of numbers.
This is equivalent to JavaScript’s ‘Intl.PluralRules.selectRange()`. The result depends on both the start and end values according to locale-specific range plural rules.
405 |
# File 'lib/icu4x/yard_docs.rb', line 405 def select_range(start_value, end_value); end |