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
@@ -4,7 +4,6 @@ module NumbersAndWords
4
4
  module Decorators
5
5
  module Hu
6
6
  class Fractional < Base
7
-
8
7
  def run
9
8
  "#{super} #{fraction_significance}"
10
9
  end
@@ -16,7 +15,7 @@ module NumbersAndWords
16
15
  end
17
16
 
18
17
  def full_fraction
19
- (0..zero_length).inject(figures.clone) { |result, el| result.unshift '0' }.to_figures
18
+ (0..zero_length).inject(figures.clone) { |result, _el| result.unshift '0' }.to_figures
20
19
  end
21
20
 
22
21
  def figures
@@ -35,4 +34,4 @@ module NumbersAndWords
35
34
  end
36
35
  end
37
36
  end
38
- end
37
+ end
@@ -9,4 +9,4 @@ module NumbersAndWords
9
9
  end
10
10
  end
11
11
  end
12
- end
12
+ end
@@ -4,7 +4,6 @@ module NumbersAndWords
4
4
  module Decorators
5
5
  module PtBr
6
6
  class Fractional < Base
7
-
8
7
  def run
9
8
  "#{super} #{fraction_significance}"
10
9
  end
@@ -16,7 +15,7 @@ module NumbersAndWords
16
15
  end
17
16
 
18
17
  def full_fraction
19
- (0..zero_length).inject(figures.clone) { |result, el| result.unshift 0 }.to_figures
18
+ (0..zero_length).inject(figures.clone) { |result, _el| result.unshift 0 }.to_figures
20
19
  end
21
20
 
22
21
  def figures
@@ -9,4 +9,4 @@ module NumbersAndWords
9
9
  end
10
10
  end
11
11
  end
12
- end
12
+ end
@@ -4,7 +4,6 @@ module NumbersAndWords
4
4
  module Decorators
5
5
  module Ru
6
6
  class Fractional < Base
7
-
8
7
  def run
9
8
  @options[:gender] = :female
10
9
  "#{super} #{fraction_significance}"
@@ -17,7 +16,7 @@ module NumbersAndWords
17
16
  end
18
17
 
19
18
  def full_fraction
20
- (0..zero_length).inject(figures.clone) { |result, el| result.unshift '0' }.to_figures
19
+ (0..zero_length).inject(figures.clone) { |result, _el| result.unshift '0' }.to_figures
21
20
  end
22
21
 
23
22
  def figures
@@ -36,4 +35,4 @@ module NumbersAndWords
36
35
  end
37
36
  end
38
37
  end
39
- end
38
+ end
@@ -4,7 +4,6 @@ module NumbersAndWords
4
4
  module Decorators
5
5
  module Ru
6
6
  class Integral < Base
7
-
8
7
  def run
9
8
  @options[:gender] = :female
10
9
  "#{super} #{integral_significance}"
@@ -24,4 +23,4 @@ module NumbersAndWords
24
23
  end
25
24
  end
26
25
  end
27
- end
26
+ end
@@ -9,4 +9,4 @@ module NumbersAndWords
9
9
  end
10
10
  end
11
11
  end
12
- end
12
+ end
@@ -4,7 +4,6 @@ module NumbersAndWords
4
4
  module Decorators
5
5
  module Ua
6
6
  class Fractional < Base
7
-
8
7
  def run
9
8
  @options[:gender] = :female
10
9
  "#{super} #{fraction_significance}"
@@ -17,7 +16,7 @@ module NumbersAndWords
17
16
  end
18
17
 
19
18
  def full_fraction
20
- (0..zero_length).inject(figures.clone) { |result, el| result.unshift '0' }.to_figures
19
+ (0..zero_length).inject(figures.clone) { |result, _el| result.unshift '0' }.to_figures
21
20
  end
22
21
 
23
22
  def figures
@@ -36,4 +35,4 @@ module NumbersAndWords
36
35
  end
37
36
  end
38
37
  end
39
- end
38
+ end
@@ -4,7 +4,6 @@ module NumbersAndWords
4
4
  module Decorators
5
5
  module Ua
6
6
  class Integral < Base
7
-
8
7
  def run
9
8
  @options[:gender] = :female
10
9
  "#{super} #{integral_significance}"
@@ -24,4 +23,4 @@ module NumbersAndWords
24
23
  end
25
24
  end
26
25
  end
27
- end
26
+ end
@@ -33,7 +33,7 @@ module NumbersAndWords
33
33
  module FiguresConverter
34
34
  module Languages
35
35
  class << self
36
- def factory strategy
36
+ def factory(strategy)
37
37
  Object.const_get("#{name}::#{I18n.language_class_name}").new strategy
38
38
  end
39
39
  end
@@ -7,7 +7,7 @@ module NumbersAndWords
7
7
 
8
8
  attr_accessor :strategy, :figures, :translations, :strings, :options
9
9
 
10
- def initialize strategy
10
+ def initialize(strategy)
11
11
  @strategy = strategy
12
12
  @figures = strategy.figures
13
13
  @translations = strategy.translations
@@ -6,7 +6,7 @@ module NumbersAndWords
6
6
  include Families::Latin
7
7
 
8
8
  def print_words
9
- 1 < complex_part.count ? print_megs_words : @strings.flatten.reverse.join('')
9
+ complex_part.count > 1 ? print_megs_words : @strings.flatten.reverse.join('')
10
10
  end
11
11
 
12
12
  def print_megs_words
@@ -14,14 +14,14 @@ module NumbersAndWords
14
14
  end
15
15
 
16
16
  def complex_number_to_words
17
- (1..@figures.capacity_count).map { |capacity|
17
+ (1..@figures.capacity_count).map do |capacity|
18
18
  @current_capacity = capacity
19
19
  capacity_iteration
20
- }
20
+ end
21
21
  end
22
22
 
23
23
  def ones
24
- super(:postfix => postfix)
24
+ super(postfix: postfix)
25
25
  end
26
26
 
27
27
  def postfix
@@ -33,15 +33,15 @@ module NumbersAndWords
33
33
  end
34
34
 
35
35
  def megs
36
- super({:number => @figures.number_in_capacity(@current_capacity)})
36
+ super({ number: @figures.number_in_capacity(@current_capacity) })
37
37
  end
38
38
 
39
39
  private
40
40
 
41
41
  def print_megs
42
- complex_part[1..-1].map { |el|
42
+ complex_part[1..-1].map do |el|
43
43
  [el[1..-1].to_a.reverse.join(''), el.first].join(' ')
44
- }.reject(&:empty?).reverse.join(' ')
44
+ end.reject(&:empty?).reverse.join(' ')
45
45
  end
46
46
 
47
47
  def print_other
@@ -53,7 +53,7 @@ module NumbersAndWords
53
53
  end
54
54
 
55
55
  def simple_part
56
- @strings.select { |f| !f.is_a?(Array) }
56
+ @strings.reject { |f| f.is_a?(Array) }
57
57
  end
58
58
 
59
59
  def complex_part
@@ -63,4 +63,4 @@ module NumbersAndWords
63
63
  end
64
64
  end
65
65
  end
66
- end
66
+ end
@@ -7,4 +7,4 @@ module NumbersAndWords
7
7
  end
8
8
  end
9
9
  end
10
- end
10
+ end
@@ -5,40 +5,38 @@ module NumbersAndWords
5
5
  class En < Base
6
6
  include Families::Latin
7
7
 
8
- [:ones, :teens, :tens, :megs].each do |method_name|
9
- define_method(method_name) {
10
- super({:prefix => maybe_ordinal(method_name)})
11
- }
8
+ %i[ones teens tens megs].each do |method_name|
9
+ define_method(method_name) do
10
+ super({ prefix: maybe_ordinal(method_name) })
11
+ end
12
12
  end
13
13
 
14
14
  def hundreds
15
- maybe_union_after_hundreds super({:prefix => maybe_ordinal(:hundreds)})
15
+ maybe_union_after_hundreds super({ prefix: maybe_ordinal(:hundreds) })
16
16
  end
17
17
 
18
18
  def zero
19
- super({:prefix => maybe_ordinal(:zero)}) unless maybe_remove_zero
19
+ super({ prefix: maybe_ordinal(:zero) }) unless maybe_remove_zero
20
20
  end
21
21
 
22
22
  def tens_with_ones
23
23
  super({
24
- :separator => maybe_hyphen_separator,
25
- :prefix => maybe_ordinal(:tens_with_ones)
24
+ separator: maybe_hyphen_separator,
25
+ prefix: maybe_ordinal(:tens_with_ones)
26
26
  })
27
27
  end
28
28
 
29
29
  def strings_logic
30
30
  if @options.pronounced.active?
31
31
  @options.pronounced.process self, @figures
32
+ elsif @figures.capacity_count
33
+ number_without_capacity_to_words + complex_number_to_words
34
+ elsif @figures.hundreds
35
+ hundreds_number_to_words
36
+ elsif @figures.tens || @figures.ones
37
+ simple_number_to_words
32
38
  else
33
- if @figures.capacity_count
34
- number_without_capacity_to_words + complex_number_to_words
35
- elsif @figures.hundreds
36
- hundreds_number_to_words
37
- elsif @figures.tens or @figures.ones
38
- simple_number_to_words
39
- else
40
- []
41
- end
39
+ []
42
40
  end
43
41
  end
44
42
 
@@ -46,11 +44,11 @@ module NumbersAndWords
46
44
  @options.remove_hyphen.result
47
45
  end
48
46
 
49
- def maybe_ordinal type
47
+ def maybe_ordinal(type)
50
48
  @options.ordinal.result type
51
49
  end
52
50
 
53
- def maybe_union_after_hundreds translations
51
+ def maybe_union_after_hundreds(translations)
54
52
  @options.hundreds_with_union.modify_or_leave translations
55
53
  end
56
54
 
@@ -6,47 +6,72 @@ module NumbersAndWords
6
6
  include Families::Latin
7
7
 
8
8
  def capacity_iteration
9
- words = []
10
- capacity_words = words_in_capacity(@current_capacity)
11
- words.push megs unless capacity_words.empty?
9
+ super.compact
10
+ end
11
+
12
+ def zero
13
+ super unless maybe_remove_zero
14
+ end
12
15
 
13
- capacity_words = capacity_words.map do |word|
14
- if twenty_one?
15
- word.gsub(@translations.ones(1), @translations.one_twenties)
16
- elsif !thousand? || !one?
17
- word.gsub(@translations.ones(1), @translations.one)
18
- end
19
- end.compact
16
+ def ones
17
+ super({ gender: gender,
18
+ is_one_thousand: one_thousand?,
19
+ is_apocopated: one_apocopated? })
20
+ end
20
21
 
21
- words + capacity_words
22
+ def tens_with_ones
23
+ if @figures.tens == 2
24
+ @translations
25
+ .twenties_with_ones(@figures, gender: gender,
26
+ is_apocopated: one_apocopated?)
27
+ else
28
+ super({ gender: gender,
29
+ is_apocopated: one_apocopated? })
30
+ end
22
31
  end
23
32
 
24
33
  def hundreds
25
- super({ is_hundred: (figures[1, 2] == [0, 1] &&
26
- simple_number_to_words.empty?) })
34
+ super({ gender: gender,
35
+ is_apocopated: hundred_apocopated? })
27
36
  end
28
37
 
29
38
  def megs
30
- if thousand? &&
31
- @figures.number_in_capacity(@current_capacity - 1) != 0
32
- @translations.thousand
33
- else
34
- super({ number: @figures.number_in_capacity(@current_capacity) })
35
- end
39
+ return @translations.megs(1, number: 1) if long_scale_thousand?
40
+ super({ number: @figures.number_in_capacity(@current_capacity) })
36
41
  end
37
42
 
38
43
  private
39
44
 
40
- def one?
41
- [@translations.ones(1)] == words_in_capacity(@current_capacity)
45
+ def one_thousand?
46
+ @current_capacity.odd? &&
47
+ @figures.ones == 1 &&
48
+ @figures.tens.nil? &&
49
+ @figures.hundreds.nil?
42
50
  end
43
51
 
44
- def thousand?
45
- @current_capacity.odd?
52
+ def long_scale_thousand?
53
+ @current_capacity.odd? &&
54
+ @figures.number_in_capacity(@current_capacity - 1) != 0
55
+ end
56
+
57
+ def one_apocopated?
58
+ true if @current_capacity > 0 && @figures.ones == 1 ||
59
+ @options.apocopated.result
60
+ end
61
+
62
+ def hundred_apocopated?
63
+ @figures.hundreds == 1 && @figures.round_hundred?
64
+ end
65
+
66
+ def gender
67
+ @current_capacity ||= 0
68
+
69
+ return 'male'.to_sym if @current_capacity >= 2
70
+ @options.gender.result
46
71
  end
47
72
 
48
- def twenty_one?
49
- figures.reverse[0..1] == [2, 1]
73
+ def maybe_remove_zero
74
+ @options.remove_zero.result
50
75
  end
51
76
  end
52
77
  end
@@ -6,9 +6,8 @@ module NumbersAndWords
6
6
  include Families::Latin
7
7
 
8
8
  def megs
9
- super({:number => @figures.number_in_capacity(@current_capacity)})
9
+ super({ number: @figures.number_in_capacity(@current_capacity) })
10
10
  end
11
-
12
11
  end
13
12
  end
14
13
  end
@@ -13,7 +13,7 @@ module NumbersAndWords
13
13
  number_without_capacity_to_words + complex_number_to_words
14
14
  elsif @figures.hundreds
15
15
  hundreds_number_to_words
16
- elsif @figures.tens or @figures.ones
16
+ elsif @figures.tens || @figures.ones
17
17
  simple_number_to_words
18
18
  else
19
19
  []
@@ -21,10 +21,10 @@ module NumbersAndWords
21
21
  end
22
22
 
23
23
  def complex_number_to_words
24
- (1..@figures.capacity_count).map { |capacity|
24
+ (1..@figures.capacity_count).map do |capacity|
25
25
  @current_capacity = capacity
26
26
  capacity_iteration
27
- }.flatten
27
+ end.flatten
28
28
  end
29
29
 
30
30
  def capacity_iteration
@@ -34,14 +34,14 @@ module NumbersAndWords
34
34
  words + capacity_words
35
35
  end
36
36
 
37
- def words_in_capacity capacity = 0
37
+ def words_in_capacity(capacity = 0)
38
38
  save_parent_figures do
39
39
  @figures = @parent_figures.figures_array_in_capacity(capacity)
40
40
  strings_logic
41
41
  end
42
42
  end
43
43
 
44
- alias_method :number_without_capacity_to_words, :words_in_capacity
44
+ alias number_without_capacity_to_words words_in_capacity
45
45
 
46
46
  def hundreds_number_to_words
47
47
  simple_number_to_words + [hundreds]
@@ -19,14 +19,14 @@ module NumbersAndWords
19
19
  end
20
20
  end
21
21
 
22
- [:ones, :tens_with_ones].each do |method_name|
23
- define_method(method_name) {
24
- super({:gender => gender})
25
- }
22
+ %i[ones tens_with_ones].each do |method_name|
23
+ define_method(method_name) do
24
+ super({ gender: gender })
25
+ end
26
26
  end
27
27
 
28
28
  def megs
29
- super({:number => @figures.number_in_capacity(@current_capacity)})
29
+ super({ number: @figures.number_in_capacity(@current_capacity) })
30
30
  end
31
31
  end
32
32
  end