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

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

Constant Summary collapse

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

Class Method Summary collapse

Class Method Details

.one_conditions(n) ⇒ Object



17
18
19
# File 'lib/numbers_and_words/i18n/plurals/lt.rb', line 17

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

.ones_conditions(n) ⇒ Object



21
22
23
# File 'lib/numbers_and_words/i18n/plurals/lt.rb', line 21

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