class NumbersAndWords::Strategies::FiguresConverter::Options::En::Ordinal

Constants

HUNDRED_TYPE
MEGS_TYPE
ZERO_TYPE

Public Instance Methods

result(type) click to toggle source
# File lib/numbers_and_words/strategies/figures_converter/options/en/ordinal.rb, line 13
def result(type)
  @type = type
  type == MEGS_TYPE ? check_megs_numbers : check_simple_numbers
end

Private Instance Methods

check_megs_numbers() click to toggle source
# File lib/numbers_and_words/strategies/figures_converter/options/en/ordinal.rb, line 24
def check_megs_numbers
  :ordinal if megs_numbers_condition && active?
end
check_simple_numbers() click to toggle source
# File lib/numbers_and_words/strategies/figures_converter/options/en/ordinal.rb, line 20
def check_simple_numbers
  :ordinal if simple_numbers_condition && active?
end
current_capacity() click to toggle source
# File lib/numbers_and_words/strategies/figures_converter/options/en/ordinal.rb, line 42
def current_capacity
  @strategy.language.current_capacity
end
language_figures() click to toggle source
# File lib/numbers_and_words/strategies/figures_converter/options/en/ordinal.rb, line 46
def language_figures
  @strategy.language.parent_figures
end
megs_numbers_condition() click to toggle source
# File lib/numbers_and_words/strategies/figures_converter/options/en/ordinal.rb, line 34
def megs_numbers_condition
  current_capacity == language_figures.ordinal_capacity
end
simple_number_to_words() click to toggle source
# File lib/numbers_and_words/strategies/figures_converter/options/en/ordinal.rb, line 38
def simple_number_to_words
  @strategy.language.simple_number_to_words
end
simple_numbers_condition() click to toggle source
# File lib/numbers_and_words/strategies/figures_converter/options/en/ordinal.rb, line 28
def simple_numbers_condition
  current_capacity.nil? &&
    (@type != HUNDRED_TYPE ||
     (@type == HUNDRED_TYPE && simple_number_to_words.empty?))
end