lib/german_numbers/parser/parser.rb in german_numbers-0.7 vs lib/german_numbers/parser/parser.rb in german_numbers-0.8
- old
+ new
@@ -47,10 +47,10 @@
end
def parse(string)
raise ParsingError if ERRORS.include?(string)
- string.split(' ').reverse.inject(0, &method(:parse_part)).tap do
+ string.split.reverse.inject(0) { parse_part(_1, _2) }.tap do
raise ParsingError unless final_order_state?
end
rescue ParsingError, StateMachine::StateError
raise ParsingError, "#{string} is not a valid German number"
end