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

Extended by:
Lt
Included in:
Lt
Defined in:
lib/numbers_and_words/i18n/plurals/lt.rb

Constant Summary collapse

RULE =
lambda do |n|
   one_conditions(n) ?
    :one : ones_conditions(n) ?
      :ones : :other
end

Instance Method Summary collapse

Instance Method Details

#one_conditions(n) ⇒ Object



13
14
15
# File 'lib/numbers_and_words/i18n/plurals/lt.rb', line 13

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

#ones_conditions(n) ⇒ Object



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

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