Module: NumbersAndWords::I18n::Plurals::Lt

Defined in:
lib/numbers_and_words/i18n/plurals/lt.rb

Constant Summary collapse

RULE =
lambda do |number|
  if one_conditions(number)
    :one
  elsif ones_conditions(number)
    :ones
  else
    :other
  end
end

Class Method Summary collapse

Class Method Details

.one_conditions(number) ⇒ Object


19
20
21
# File 'lib/numbers_and_words/i18n/plurals/lt.rb', line 19

def one_conditions(number)
  number % 10 == 1 && number % 100 != 11
end

.ones_conditions(number) ⇒ Object


23
24
25
26
# File 'lib/numbers_and_words/i18n/plurals/lt.rb', line 23

def ones_conditions(number)
  [2, 3, 4, 5, 6, 7, 8, 9].include?(number % 10) &&
    ![12, 13, 14, 15, 16, 17, 18, 19].include?(number % 100)
end