Class: Money::Parser::Accounting

Inherits:
Fuzzy
  • Object
show all
Defined in:
lib/money/parser/accounting.rb

Constant Summary

Constants inherited from Fuzzy

Fuzzy::CHINESE_NUMERIC_REGEX, Fuzzy::COMMA_DECIMAL_REGEX, Fuzzy::DOT_DECIMAL_REGEX, Fuzzy::ESCAPED_MARKS, Fuzzy::ESCAPED_NON_COMMA_MARKS, Fuzzy::ESCAPED_NON_DOT_MARKS, Fuzzy::ESCAPED_NON_SPACE_MARKS, Fuzzy::INDIAN_NUMERIC_REGEX, Fuzzy::MARKS, Fuzzy::NUMERIC_REGEX

Instance Method Summary collapse

Methods inherited from Fuzzy

parse

Instance Method Details

#parse(input, currency = nil, **options) ⇒ Object



5
6
7
8
# File 'lib/money/parser/accounting.rb', line 5

def parse(input, currency = nil, **options)
  # set () to mean negativity. ignore $
  super(input.gsub(/\(\$?(.*?)\)/, '-\1'), currency, **options)
end