Skip to content

Commit fafbaf0

Browse files
committed
refactor extract_sign method
1 parent 4190204 commit fafbaf0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/monetize/parser.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ def extract_multiplier
173173
end
174174

175175
def extract_sign(input)
176-
result = (input =~ /^-+(.*)$/ || input =~ /^(.*)-+$/) ? [true, $1] : [false, input]
176+
match = input =~ /^-+(.*)$/ || input =~ /^(.*)-+$/
177+
result = match ? [true, $1] : [false, input]
177178
fail ParseError, 'Invalid amount (hyphen)' if result[1].include?('-')
178179
result
179180
end

0 commit comments

Comments
 (0)