Sha256: 9f1e60816b1ad8e6a069b7420f2c53259d86025239a02afb18021e53b98eef6f

Contents?: true

Size: 887 Bytes

Versions: 8

Compression:

Stored size: 887 Bytes

Contents

module Beatport
  class Price < Money
    # These defaults are no longer(?) being carried over from Money, so we redefine them here

    # Set the default bank for creating new +Money+ objects.
    self.default_bank = Bank::VariableExchange.instance

    # Set the default currency for creating new +Money+ object.
    self.default_currency = Currency.new("USD")

    # Default to using i18n
    self.use_i18n = true

    # Default to not using currency symbol assumptions when parsing
    self.assume_from_symbol = false

    # Default to not using infinite precision cents
    self.infinite_precision = false

    # Default to bankers rounding
    self.rounding_mode = BigDecimal::ROUND_HALF_EVEN

    # Default the conversion of Rationals precision to 16
    self.conversion_precision = 16

    def initialize(data = {})
      super(data['value'] || 0, data['code'])
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
beatport-0.2.3 lib/beatport/price.rb
beatport-0.2.2 lib/beatport/price.rb
beatport-0.2.1 lib/beatport/price.rb
beatport-0.2.0 lib/beatport/price.rb
beatport-0.1.10 lib/beatport/price.rb
beatport-0.1.9 lib/beatport/price.rb
beatport-0.1.8 lib/beatport/price.rb
beatport-0.1.7 lib/beatport/price.rb