Module: CldrPlurals::RubyRuntime

Defined in:
lib/cldr-plurals/ruby_runtime.rb

Class Method Summary collapse

Class Method Details

.build_args_for(num_str) ⇒ Object



7
8
9
10
11
12
# File 'lib/cldr-plurals/ruby_runtime.rb', line 7

def build_args_for(num_str)
  [
    n(num_str), i(num_str), f(num_str),
    t(num_str), v(num_str), w(num_str)
  ]
end

.f(str) ⇒ Object



28
29
30
# File 'lib/cldr-plurals/ruby_runtime.rb', line 28

def f(str)
  to_num(_f(str))
end

.i(str) ⇒ Object



24
25
26
# File 'lib/cldr-plurals/ruby_runtime.rb', line 24

def i(str)
  to_num(_i(str))
end

.n(str) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/cldr-plurals/ruby_runtime.rb', line 14

def n(str)
  to_num(
    if str.include?('.')
      _n(str).gsub(/([0]+\z)/, '').chomp('.')
    else
      _n(str)
    end
  )
end

.t(str) ⇒ Object



32
33
34
# File 'lib/cldr-plurals/ruby_runtime.rb', line 32

def t(str)
  to_num(_t(str))
end

.v(str) ⇒ Object



36
37
38
# File 'lib/cldr-plurals/ruby_runtime.rb', line 36

def v(str)
  to_num(_v(str))
end

.w(str) ⇒ Object



40
41
42
# File 'lib/cldr-plurals/ruby_runtime.rb', line 40

def w(str)
  to_num(_w(str))
end