numbers_and_words 0.11.0 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/lib/numbers_and_words/core_ext/array.rb +2 -2
  3. data/lib/numbers_and_words/core_ext/float.rb +1 -1
  4. data/lib/numbers_and_words/core_ext/integer.rb +1 -1
  5. data/lib/numbers_and_words/helper_classes.rb +1 -1
  6. data/lib/numbers_and_words/helper_classes/array_extensions/helpers.rb +11 -12
  7. data/lib/numbers_and_words/helper_classes/figures_array.rb +1 -4
  8. data/lib/numbers_and_words/helper_classes/words_array.rb +2 -4
  9. data/lib/numbers_and_words/i18n.rb +4 -4
  10. data/lib/numbers_and_words/i18n/initialization.rb +2 -2
  11. data/lib/numbers_and_words/i18n/locales/numbers.en.yml +3 -3
  12. data/lib/numbers_and_words/i18n/locales/numbers.es.yml +86 -25
  13. data/lib/numbers_and_words/i18n/locales/numbers.fr.yml +54 -1
  14. data/lib/numbers_and_words/i18n/locales/numbers.pt-BR.yml +4 -4
  15. data/lib/numbers_and_words/i18n/locales/numbers.pt.yml +0 -1
  16. data/lib/numbers_and_words/i18n/pluralization.rb +2 -3
  17. data/lib/numbers_and_words/i18n/plurals/fr.rb +3 -3
  18. data/lib/numbers_and_words/i18n/plurals/lt.rb +11 -8
  19. data/lib/numbers_and_words/i18n/plurals/lv.rb +3 -3
  20. data/lib/numbers_and_words/i18n/plurals/ru.rb +15 -10
  21. data/lib/numbers_and_words/strategies.rb +1 -1
  22. data/lib/numbers_and_words/strategies/array_joiner.rb +1 -2
  23. data/lib/numbers_and_words/strategies/array_joiner/languages.rb +3 -1
  24. data/lib/numbers_and_words/strategies/array_joiner/languages/base.rb +1 -1
  25. data/lib/numbers_and_words/strategies/array_joiner/languages/es.rb +10 -0
  26. data/lib/numbers_and_words/strategies/array_joiner/languages/families/base.rb +0 -1
  27. data/lib/numbers_and_words/strategies/array_joiner/languages/fr.rb +10 -0
  28. data/lib/numbers_and_words/strategies/figures_converter.rb +1 -2
  29. data/lib/numbers_and_words/strategies/figures_converter/decorators.rb +8 -6
  30. data/lib/numbers_and_words/strategies/figures_converter/decorators/base.rb +2 -2
  31. data/lib/numbers_and_words/strategies/figures_converter/decorators/en/base.rb +1 -1
  32. data/lib/numbers_and_words/strategies/figures_converter/decorators/en/fractional.rb +2 -3
  33. data/lib/numbers_and_words/strategies/figures_converter/decorators/en/integral.rb +1 -1
  34. data/lib/numbers_and_words/strategies/figures_converter/decorators/es.rb +3 -0
  35. data/lib/numbers_and_words/strategies/figures_converter/decorators/es/base.rb +12 -0
  36. data/lib/numbers_and_words/strategies/figures_converter/decorators/es/fractional.rb +38 -0
  37. data/lib/numbers_and_words/strategies/figures_converter/decorators/es/integral.rb +12 -0
  38. data/lib/numbers_and_words/strategies/figures_converter/decorators/fr.rb +3 -0
  39. data/lib/numbers_and_words/strategies/figures_converter/decorators/fr/base.rb +12 -0
  40. data/lib/numbers_and_words/strategies/figures_converter/decorators/fr/fractional.rb +37 -0
  41. data/lib/numbers_and_words/strategies/figures_converter/decorators/fr/integral.rb +12 -0
  42. data/lib/numbers_and_words/strategies/figures_converter/decorators/hu.rb +1 -1
  43. data/lib/numbers_and_words/strategies/figures_converter/decorators/hu/base.rb +1 -1
  44. data/lib/numbers_and_words/strategies/figures_converter/decorators/hu/fractional.rb +2 -3
  45. data/lib/numbers_and_words/strategies/figures_converter/decorators/hu/integral.rb +1 -1
  46. data/lib/numbers_and_words/strategies/figures_converter/decorators/pt-BR/fractional.rb +1 -2
  47. data/lib/numbers_and_words/strategies/figures_converter/decorators/ru/base.rb +1 -1
  48. data/lib/numbers_and_words/strategies/figures_converter/decorators/ru/fractional.rb +2 -3
  49. data/lib/numbers_and_words/strategies/figures_converter/decorators/ru/integral.rb +1 -2
  50. data/lib/numbers_and_words/strategies/figures_converter/decorators/ua/base.rb +1 -1
  51. data/lib/numbers_and_words/strategies/figures_converter/decorators/ua/fractional.rb +2 -3
  52. data/lib/numbers_and_words/strategies/figures_converter/decorators/ua/integral.rb +1 -2
  53. data/lib/numbers_and_words/strategies/figures_converter/languages.rb +1 -1
  54. data/lib/numbers_and_words/strategies/figures_converter/languages/base.rb +1 -1
  55. data/lib/numbers_and_words/strategies/figures_converter/languages/de.rb +9 -9
  56. data/lib/numbers_and_words/strategies/figures_converter/languages/en-GB.rb +1 -1
  57. data/lib/numbers_and_words/strategies/figures_converter/languages/en.rb +17 -19
  58. data/lib/numbers_and_words/strategies/figures_converter/languages/es.rb +50 -25
  59. data/lib/numbers_and_words/strategies/figures_converter/languages/et.rb +1 -2
  60. data/lib/numbers_and_words/strategies/figures_converter/languages/families/base.rb +5 -5
  61. data/lib/numbers_and_words/strategies/figures_converter/languages/families/cyrillic.rb +5 -5
  62. data/lib/numbers_and_words/strategies/figures_converter/languages/families/helpers.rb +10 -14
  63. data/lib/numbers_and_words/strategies/figures_converter/languages/fr.rb +7 -7
  64. data/lib/numbers_and_words/strategies/figures_converter/languages/hu.rb +8 -8
  65. data/lib/numbers_and_words/strategies/figures_converter/languages/ka.rb +8 -10
  66. data/lib/numbers_and_words/strategies/figures_converter/languages/lt.rb +6 -6
  67. data/lib/numbers_and_words/strategies/figures_converter/languages/lv.rb +2 -2
  68. data/lib/numbers_and_words/strategies/figures_converter/languages/pt-BR.rb +24 -26
  69. data/lib/numbers_and_words/strategies/figures_converter/languages/pt.rb +6 -7
  70. data/lib/numbers_and_words/strategies/figures_converter/languages/tr.rb +4 -4
  71. data/lib/numbers_and_words/strategies/figures_converter/options.rb +6 -5
  72. data/lib/numbers_and_words/strategies/figures_converter/options/en-GB/hundreds_with_union.rb +1 -1
  73. data/lib/numbers_and_words/strategies/figures_converter/options/en-GB/ordinal.rb +1 -1
  74. data/lib/numbers_and_words/strategies/figures_converter/options/en-GB/remove_hyphen.rb +1 -1
  75. data/lib/numbers_and_words/strategies/figures_converter/options/en-GB/remove_zero.rb +1 -1
  76. data/lib/numbers_and_words/strategies/figures_converter/options/en/hundreds_with_union.rb +3 -3
  77. data/lib/numbers_and_words/strategies/figures_converter/options/en/ordinal.rb +3 -3
  78. data/lib/numbers_and_words/strategies/figures_converter/options/en/pronounced.rb +14 -23
  79. data/lib/numbers_and_words/strategies/figures_converter/options/en/remove_hyphen.rb +2 -3
  80. data/lib/numbers_and_words/strategies/figures_converter/options/en/remove_zero.rb +2 -2
  81. data/lib/numbers_and_words/strategies/figures_converter/options/es.rb +3 -0
  82. data/lib/numbers_and_words/strategies/figures_converter/options/es/apocopated.rb +28 -0
  83. data/lib/numbers_and_words/strategies/figures_converter/options/es/gender.rb +28 -0
  84. data/lib/numbers_and_words/strategies/figures_converter/options/es/remove_zero.rb +28 -0
  85. data/lib/numbers_and_words/strategies/figures_converter/options/hu/ordinal.rb +3 -3
  86. data/lib/numbers_and_words/strategies/figures_converter/options/pt-BR/gender.rb +2 -2
  87. data/lib/numbers_and_words/strategies/figures_converter/options/pt-BR/ordinal.rb +1 -1
  88. data/lib/numbers_and_words/strategies/figures_converter/options/pt-BR/remove_zero.rb +1 -1
  89. data/lib/numbers_and_words/strategies/figures_converter/options/ru/gender.rb +2 -2
  90. data/lib/numbers_and_words/strategies/figures_converter/options/ua/gender.rb +2 -2
  91. data/lib/numbers_and_words/translations/base.rb +2 -2
  92. data/lib/numbers_and_words/translations/de.rb +5 -5
  93. data/lib/numbers_and_words/translations/es.rb +29 -24
  94. data/lib/numbers_and_words/translations/et.rb +3 -3
  95. data/lib/numbers_and_words/translations/extensions/fraction_significance.rb +4 -5
  96. data/lib/numbers_and_words/translations/families/base.rb +8 -8
  97. data/lib/numbers_and_words/translations/families/cyrillic.rb +6 -6
  98. data/lib/numbers_and_words/translations/families/latin.rb +6 -6
  99. data/lib/numbers_and_words/translations/fr.rb +16 -8
  100. data/lib/numbers_and_words/translations/hu.rb +3 -3
  101. data/lib/numbers_and_words/translations/it.rb +3 -3
  102. data/lib/numbers_and_words/translations/ka.rb +13 -13
  103. data/lib/numbers_and_words/translations/lt.rb +4 -5
  104. data/lib/numbers_and_words/translations/lv.rb +4 -5
  105. data/lib/numbers_and_words/translations/nl.rb +3 -3
  106. data/lib/numbers_and_words/translations/pt-BR.rb +18 -18
  107. data/lib/numbers_and_words/translations/pt.rb +4 -5
  108. data/lib/numbers_and_words/translations/ru.rb +5 -5
  109. data/lib/numbers_and_words/translations/se.rb +2 -2
  110. data/lib/numbers_and_words/translations/tr.rb +3 -4
  111. data/lib/numbers_and_words/translations/ua.rb +3 -3
  112. data/lib/numbers_and_words/version.rb +1 -1
  113. data/lib/numbers_and_words/wrappers.rb +1 -1
  114. data/lib/numbers_and_words/wrappers/float.rb +9 -9
  115. data/lib/numbers_and_words/wrappers/integer.rb +3 -3
  116. metadata +16 -4
  117. data/lib/numbers_and_words/helper_classes/array_extensions/validations.rb +0 -19
  118. data/lib/numbers_and_words/i18n/plurals/pt-BR.rb +0 -15
@@ -6,37 +6,30 @@ module NumbersAndWords
6
6
  class Pronounced
7
7
  attr_accessor :strategy, :options
8
8
 
9
- def initialize proxy, *args, &block
9
+ def initialize(proxy, *_args)
10
10
  @strategy = proxy.strategy
11
11
  @options = proxy.options
12
12
  end
13
13
 
14
-
15
- def result
16
- active? ? 'PRONOUNCED' : 'NOTPRONOUNCED'
17
- end
18
-
19
14
  def active?
20
15
  @options[:pronounced]
21
16
  end
22
17
 
23
- def process language, figures
24
- if figures.to_a.count > 4
25
- language.number_without_capacity_to_words + language.complex_number_to_words
26
- elsif figures.capacity_count
18
+ def process(language, figures)
19
+ if figures.capacity_count
27
20
  handle_thousands language, figures
28
21
  elsif figures.hundreds
29
22
  handle_hundreds language, figures
30
- elsif figures.tens or figures.ones
23
+ elsif figures.tens || figures.ones
31
24
  language.simple_number_to_words
32
25
  else
33
26
  []
34
27
  end
35
28
  end
36
29
 
37
- def handle_thousands language, figures
30
+ def handle_thousands(language, figures)
38
31
  _units, _tens, hundreds, thousands = *figures.to_a.dup
39
- if hundreds == 0
32
+ if hundreds.zero?
40
33
  language.number_without_capacity_to_words + language.complex_number_to_words
41
34
  else
42
35
  result = tens_with_oh language, figures
@@ -44,28 +37,26 @@ module NumbersAndWords
44
37
  end
45
38
  end
46
39
 
47
- def handle_hundreds language, figures
40
+ def handle_hundreds(language, figures)
48
41
  _units, _tens, hundreds = *figures.to_a.dup
49
42
  result = tens_with_oh language, figures
50
43
  result.push hundreds.to_words
51
44
  end
52
45
 
53
- def tens_with_oh language, figures
46
+ def tens_with_oh(language, figures)
54
47
  units, tens = *figures.to_a.dup
55
48
  result = []
56
- if tens == 0
57
- if units == 0
49
+ if tens.zero?
50
+ if units.zero?
58
51
  result.push 'hundred'
59
52
  else
60
53
  result.push language.ones
61
54
  result.push 'oh'
62
55
  end
63
- else
64
- if figures.teens
65
- result.push language.teens
66
- elsif figures.tens
67
- result.push language.complex_tens
68
- end
56
+ elsif figures.teens
57
+ result.push language.teens
58
+ elsif figures.tens
59
+ result.push language.complex_tens
69
60
  end
70
61
  end
71
62
  end
@@ -6,12 +6,11 @@ module NumbersAndWords
6
6
  class RemoveHyphen
7
7
  attr_accessor :strategy, :options
8
8
 
9
- def initialize proxy, *args, &block
9
+ def initialize(proxy, *_args)
10
10
  @strategy = proxy.strategy
11
11
  @options = proxy.options
12
12
  end
13
13
 
14
-
15
14
  def result
16
15
  active? ? ' ' : '-'
17
16
  end
@@ -26,4 +25,4 @@ module NumbersAndWords
26
25
  end
27
26
  end
28
27
  end
29
- end
28
+ end
@@ -6,7 +6,7 @@ module NumbersAndWords
6
6
  class RemoveZero
7
7
  attr_accessor :strategy, :options
8
8
 
9
- def initialize proxy, *args, &block
9
+ def initialize(proxy, *_args)
10
10
  @strategy = proxy.strategy
11
11
  @options = proxy.options
12
12
  end
@@ -25,4 +25,4 @@ module NumbersAndWords
25
25
  end
26
26
  end
27
27
  end
28
- end
28
+ end
@@ -0,0 +1,3 @@
1
+ require 'numbers_and_words/strategies/figures_converter/options/es/apocopated'
2
+ require 'numbers_and_words/strategies/figures_converter/options/es/gender'
3
+ require 'numbers_and_words/strategies/figures_converter/options/es/remove_zero'
@@ -0,0 +1,28 @@
1
+ module NumbersAndWords
2
+ module Strategies
3
+ module FiguresConverter
4
+ module Options
5
+ module Es
6
+ class Apocopated
7
+ attr_accessor :strategy, :options
8
+
9
+ def initialize(proxy, *_args)
10
+ @strategy = proxy.strategy
11
+ @options = proxy.options
12
+ end
13
+
14
+ def result
15
+ active?
16
+ end
17
+
18
+ private
19
+
20
+ def active?
21
+ @options[:apocopated]
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,28 @@
1
+ module NumbersAndWords
2
+ module Strategies
3
+ module FiguresConverter
4
+ module Options
5
+ module Es
6
+ class Gender
7
+ attr_accessor :strategy, :options
8
+
9
+ def initialize(proxy, *_args)
10
+ @strategy = proxy.strategy
11
+ @options = proxy.options
12
+ end
13
+
14
+ def result
15
+ active? ? @options[:gender].to_sym : :male
16
+ end
17
+
18
+ private
19
+
20
+ def active?
21
+ @options[:gender]
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,28 @@
1
+ module NumbersAndWords
2
+ module Strategies
3
+ module FiguresConverter
4
+ module Options
5
+ module Es
6
+ class RemoveZero
7
+ attr_accessor :strategy, :options
8
+
9
+ def initialize(proxy, *_args)
10
+ @strategy = proxy.strategy
11
+ @options = proxy.options
12
+ end
13
+
14
+ def result
15
+ active?
16
+ end
17
+
18
+ private
19
+
20
+ def active?
21
+ @options[:remove_zero]
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -8,12 +8,12 @@ module NumbersAndWords
8
8
  HUNDRED_TYPE = :hundreds
9
9
  MEGS_TYPE = :megs
10
10
 
11
- def initialize proxy, *args, &block
11
+ def initialize(proxy, *_args)
12
12
  @strategy = proxy.strategy
13
13
  @options = proxy.options
14
14
  end
15
15
 
16
- def result type
16
+ def result(type)
17
17
  @type = type
18
18
  MEGS_TYPE != type ? check_simple_numbers : check_megs_numbers
19
19
  end
@@ -57,4 +57,4 @@ module NumbersAndWords
57
57
  end
58
58
  end
59
59
  end
60
- end
60
+ end
@@ -6,14 +6,14 @@ module NumbersAndWords
6
6
  class Gender
7
7
  attr_accessor :strategy, :options
8
8
 
9
- def initialize proxy, *args, &block
9
+ def initialize(proxy, *_args)
10
10
  @strategy = proxy.strategy
11
11
  @options = proxy.options
12
12
  end
13
13
 
14
14
  def result
15
15
  gender = active? ? @options[:gender].to_sym : :male
16
- [:male, :female].include?(gender) ? gender : :male
16
+ %i[male female].include?(gender) ? gender : :male
17
17
  end
18
18
 
19
19
  private
@@ -4,7 +4,7 @@ module NumbersAndWords
4
4
  module Options
5
5
  module PtBr
6
6
  class Ordinal
7
- def initialize proxy, *args, &block
7
+ def initialize(proxy, *_args)
8
8
  @strategy = proxy.strategy
9
9
  @options = proxy.options
10
10
  end
@@ -6,7 +6,7 @@ module NumbersAndWords
6
6
  class RemoveZero
7
7
  attr_accessor :strategy, :options
8
8
 
9
- def initialize proxy, *args, &block
9
+ def initialize(proxy, *_args)
10
10
  @strategy = proxy.strategy
11
11
  @options = proxy.options
12
12
  end
@@ -6,7 +6,7 @@ module NumbersAndWords
6
6
  class Gender
7
7
  attr_accessor :strategy, :options
8
8
 
9
- def initialize proxy, *args, &block
9
+ def initialize(proxy, *_args)
10
10
  @strategy = proxy.strategy
11
11
  @options = proxy.options
12
12
  end
@@ -25,4 +25,4 @@ module NumbersAndWords
25
25
  end
26
26
  end
27
27
  end
28
- end
28
+ end
@@ -6,7 +6,7 @@ module NumbersAndWords
6
6
  class Gender
7
7
  attr_accessor :strategy, :options
8
8
 
9
- def initialize proxy, *args, &block
9
+ def initialize(proxy, *_args)
10
10
  @strategy = proxy.strategy
11
11
  @options = proxy.options
12
12
  end
@@ -25,4 +25,4 @@ module NumbersAndWords
25
25
  end
26
26
  end
27
27
  end
28
- end
28
+ end
@@ -3,8 +3,8 @@ module NumbersAndWords
3
3
  class Base
4
4
  I18N_NAMESPACE = :numbers
5
5
 
6
- def t attribute, options = {}
7
- ::I18n.t attribute, options.merge(:scope => I18N_NAMESPACE)
6
+ def t(attribute, options = {})
7
+ ::I18n.t attribute, options.merge(scope: I18N_NAMESPACE)
8
8
  end
9
9
  end
10
10
  end
@@ -4,21 +4,21 @@ module NumbersAndWords
4
4
  include NumbersAndWords::Translations::Families::Latin
5
5
  DEFAULT_POSTFIX = :combine
6
6
 
7
- def ones number, options = {}
7
+ def ones(number, options = {})
8
8
  t([options[:prefix], :ones, options[:postfix] || DEFAULT_POSTFIX].join('.'))[number]
9
9
  end
10
10
 
11
- def tens_with_ones numbers, options = {}
11
+ def tens_with_ones(numbers, options = {})
12
12
  [tens(numbers[1]), ones(numbers[0], options)].reverse.join 'und'
13
13
  end
14
14
 
15
- def hundreds number, options = {}
15
+ def hundreds(number, _options = {})
16
16
  [ones(number), t(:hundreds)].join('')
17
17
  end
18
18
 
19
- def zero options = {}
19
+ def zero(_options = {})
20
20
  ones 0
21
21
  end
22
22
  end
23
23
  end
24
- end
24
+ end
@@ -2,43 +2,48 @@ module NumbersAndWords
2
2
  module Translations
3
3
  class Es < Base
4
4
  include NumbersAndWords::Translations::Families::Latin
5
+ include NumbersAndWords::Translations::Extensions::FractionSignificance
5
6
 
6
- TENS_CASE = 2
7
-
8
- def one
9
- t(:one)
10
- end
11
-
12
- def ones(number, _options = {})
13
- t(:ones)[number]
7
+ def zero(_options = {})
8
+ t(%i[ones male].join('.'))[0]
14
9
  end
15
10
 
16
- def one_twenties
17
- t(:one_twenties)
11
+ def ones(number, options = {})
12
+ return if options[:is_one_thousand]
13
+ return t(%i[ones apocopated].join('.')) if options[:is_apocopated]
14
+ t([:ones, options[:gender]].join('.'))[number]
18
15
  end
19
16
 
20
- def ones_twenties(number)
21
- t(:ones_twenties)[number]
17
+ def twenties_with_ones(numbers, options = {})
18
+ return t(%i[twenties apocopated].join('.')) if options[:is_apocopated]
19
+ t([:twenties, options[:gender]].join('.'))[numbers[0]]
22
20
  end
23
21
 
24
- def tens(numbers, options = {})
25
- options[:alone] = true if options[:alone].nil?
26
- (numbers == TENS_CASE && options[:alone]) ? t(:twenty) : super(numbers)
22
+ def tens_with_ones(numbers, options = {})
23
+ ones_number = if options[:is_apocopated] && numbers[0] == 1
24
+ t(%i[ones apocopated].join('.'))
25
+ else
26
+ t([:ones, options[:gender]].join('.'))[numbers[0]]
27
+ end
28
+ [tens(numbers[1], alone: false), t(:union), ones_number].join(' ')
27
29
  end
28
30
 
29
- def tens_with_ones(numbers, _options = {})
30
- union = numbers[1] == TENS_CASE ? '' : " #{t(:union)} "
31
- ones_number = numbers[1] == TENS_CASE ? ones_twenties(numbers[0]) : ones(numbers[0])
32
- [tens(numbers[1], alone: false), union, ones_number].join
31
+ def hundreds(number, options = {})
32
+ return t(%i[hundreds apocopated].join('.')) if options[:is_apocopated]
33
+ t([:hundreds, options[:gender]].join('.'))[number]
33
34
  end
34
35
 
35
- def hundreds(number, options = {})
36
- options[:is_hundred] = false if options[:is_hundred].nil?
37
- options[:is_hundred] ? t(:one_hundred) : t(:hundreds)[number - 1]
36
+ def micros(capacity, number = nil)
37
+ micro, prefix = capacity
38
+ micros = number ? t(micro(micro), count: number) : micro(micro)
39
+ [micro_prefix(prefix), micros].compact.join
38
40
  end
39
41
 
40
- def thousand
41
- t(:thousand)
42
+ def micro_prefix(capacity)
43
+ case capacity
44
+ when 2 then t('micro_prefix.hundreds')
45
+ when 1 then t('micro_prefix.tens')
46
+ end
42
47
  end
43
48
  end
44
49
  end
@@ -3,11 +3,11 @@ module NumbersAndWords
3
3
  class Et < Base
4
4
  include NumbersAndWords::Translations::Families::Latin
5
5
 
6
- def tens_with_ones numbers, options = {}
7
- [tens(numbers[1], :alone => false), ones(numbers[0])].join ' '
6
+ def tens_with_ones(numbers, _options = {})
7
+ [tens(numbers[1], alone: false), ones(numbers[0])].join ' '
8
8
  end
9
9
 
10
- def hundreds number, options = {}
10
+ def hundreds(number, options = {})
11
11
  options[:separator] = ''
12
12
  super number, options
13
13
  end
@@ -2,18 +2,17 @@ module NumbersAndWords
2
2
  module Translations
3
3
  module Extensions
4
4
  module FractionSignificance
5
-
6
- def micros capacity, number = nil, separator = '-'
5
+ def micros(capacity, number = nil, separator = '-')
7
6
  micro, prefix = capacity
8
- micros = number ? t(micro(micro), :count => number) : micro(micro)
7
+ micros = number ? t(micro(micro), count: number) : micro(micro)
9
8
  [micro_prefix(prefix), micros].compact.join separator
10
9
  end
11
10
 
12
- def micro capacity
11
+ def micro(capacity)
13
12
  t(:micro)[capacity]
14
13
  end
15
14
 
16
- def micro_prefix capacity
15
+ def micro_prefix(capacity)
17
16
  case capacity
18
17
  when 2 then t(:hundreds)
19
18
  when 1 then tens(1)