Skip to content

Commit

Permalink
Avoid adding all array extensions to the standard Array class (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvz authored Jan 5, 2021
1 parent 16c1452 commit 630b99e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/numbers_and_words/helper_classes/figures_array.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module NumbersAndWords
class FiguresArray < Array
Array.include ArrayExtensions::Helpers
include ArrayExtensions::Helpers

def to_words(options = {})
local_language { Strategies.figures_converter.new(self, options).run }
Expand All @@ -14,6 +14,10 @@ def reverse
super.to_figures
end

def figures_array_in_capacity(capacity)
super.to_figures
end

def local_language(&block)
::I18n.with_locale(I18n.local_language, &block)
end
Expand Down

0 comments on commit 630b99e

Please sign in to comment.