Class: AccountingMoneyParser

Inherits:
MoneyParser show all
Defined in:
lib/money/accounting_money_parser.rb

Constant Summary

Constants inherited from MoneyParser

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

Instance Method Summary collapse

Methods inherited from MoneyParser

parse

Instance Method Details

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



4
5
6
7
# File 'lib/money/accounting_money_parser.rb', line 4

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