Class: TrangeFrange::One

Inherits:
Struct
  • Object
show all
Includes:
BaseHelper
Defined in:
lib/trange_frange/one.rb

Constant Summary collapse

ONES =
{
  '0' => '',        # not printed
  '1' => {
    :m => 'jedan',  # male gender
    :f => 'jedna'   # female gender
  },
  '2' => {
    :m => 'dva',
    :f => 'dve'
  },
  '3' => 'tri',
  '4' => 'četiri',
  '5' => 'pet',
  '6' => 'šest',
  '7' => 'sedam',
  '8' => 'osam',
  '9' => 'devet'
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#baseObject

Returns the value of attribute base

Returns:

  • (Object)

    the current value of base



4
5
6
# File 'lib/trange_frange/one.rb', line 4

def base
  @base
end

#magnitudeObject

Returns the value of attribute magnitude

Returns:

  • (Object)

    the current value of magnitude



4
5
6
# File 'lib/trange_frange/one.rb', line 4

def magnitude
  @magnitude
end

Instance Method Details

#wordObject



26
27
28
29
30
31
# File 'lib/trange_frange/one.rb', line 26

def word
  order_condition.add { String.new if object_base.teen? }
  order_condition.add { ONES[object_base.member.one][gender] if object_base.gender? }
  order_condition.add { ONES[object_base.member.one] }
  order_condition.match!
end