We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4190204 commit fafbaf0Copy full SHA for fafbaf0
1 file changed
lib/monetize/parser.rb
@@ -173,7 +173,8 @@ def extract_multiplier
173
end
174
175
def extract_sign(input)
176
- result = (input =~ /^-+(.*)$/ || input =~ /^(.*)-+$/) ? [true, $1] : [false, input]
+ match = input =~ /^-+(.*)$/ || input =~ /^(.*)-+$/
177
+ result = match ? [true, $1] : [false, input]
178
fail ParseError, 'Invalid amount (hyphen)' if result[1].include?('-')
179
result
180
0 commit comments