Sha256: 6e8e58b4c51e973ec0075140516e22619c01f41888ed37e2f058b0126847a0a2

Contents?: true

Size: 281 Bytes

Versions: 12

Compression:

Stored size: 281 Bytes

Contents

# frozen_string_literal: true
class Money
  module Parser
    class Accounting < Fuzzy
      def parse(input, currency = nil, **options)
        # set () to mean negativity. ignore $
        super(input.gsub(/\(\$?(.*?)\)/, '-\1'), currency, **options)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
shopify-money-3.0.0 lib/money/parser/accounting.rb
shopify-money-2.2.2 lib/money/parser/accounting.rb
shopify-money-2.2.1 lib/money/parser/accounting.rb
shopify-money-2.2.0 lib/money/parser/accounting.rb
shopify-money-2.0.0 lib/money/parser/accounting.rb
shopify-money-1.3.0 lib/money/parser/accounting.rb
shopify-money-1.2.1 lib/money/parser/accounting.rb
shopify-money-1.2.0 lib/money/parser/accounting.rb
shopify-money-1.1.2 lib/money/parser/accounting.rb
shopify-money-1.1.1 lib/money/parser/accounting.rb
shopify-money-1.1.0 lib/money/parser/accounting.rb
shopify-money-1.0.2.pre lib/money/parser/accounting.rb