Class: NumbersAndWords::Strategies::FiguresConverter::Languages::Cs

Inherits:
Base
  • Object
show all
Defined in:
lib/numbers_and_words/strategies/figures_converter/languages/cs.rb

Instance Attribute Summary

Attributes inherited from Base

#decorator, #figures, #language, #options, #translations

Instance Method Summary collapse

Methods inherited from Base

#initialize, #run

Constructor Details

This class inherits a constructor from NumbersAndWords::Strategies::FiguresConverter::Base

Instance Method Details

#genderObject



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/numbers_and_words/strategies/figures_converter/languages/cs.rb', line 23

def gender
  # @current_capacity = order of block of 3 digits, backwards (0 = hundreds tens ones)
  @current_capacity ||= 0

  if @current_capacity.zero?
    options.gender.result
  elsif @current_capacity > 2 && @current_capacity.odd?
    :female # miliardy, biliardy, triliardy...
  else
    :male
  end
end

#megs(*args) ⇒ Object



19
20
21
# File 'lib/numbers_and_words/strategies/figures_converter/languages/cs.rb', line 19

def megs(*args)
  super({ number: @figures.number_in_capacity(@current_capacity) }.merge(args.first || {}))
end

#zeroObject



15
16
17
# File 'lib/numbers_and_words/strategies/figures_converter/languages/cs.rb', line 15

def zero
  super(internal_options) unless maybe_remove_zero
end