def parse(input, currency = nil)
i = input.to_s.strip
c = if Money.assume_from_symbol && i =~ /^(\$|€|£)/
case i
when /^$/ then "USD"
when /^€/ then "EUR"
when /^£/ then "GBP"
end
else
i[/[A-Z]{2,3}/]
end
if currency.nil? and c.nil?
currency = Money.default_currency
elsif currency.nil?
currency = c
elsif c.nil?
currency = currency
elsif currency != c
raise ArgumentError, "Mismatching Currencies"
end
currency = Money::Currency.wrap(currency)
cents = extract_cents(i, currency)
new(cents, currency)
end