Sha256: 20f8c1e9a45fb2448faae5d3ed683d3f524b822718b6f0b5dbd39f7fc52b5b04

Contents?: true

Size: 889 Bytes

Versions: 2

Compression:

Stored size: 889 Bytes

Contents

require "strict_money/amount"
require "strict_money/configuration"
require "strict_money/version"
require "strict_money/railtie" if defined?(Rails::Railtie)
require "forwardable"

# Manipulate money and currency with strictness around currencies and time periods.
module StrictMoney
  # Exception raised when someone uses a currency that is not supported within
  # the application.
  UnsupportedCurrencyError = Class.new(StandardError)
  # Exception raised when someone uses an invalid currency in a method call.
  WrongCurrencyError = Class.new(StandardError)

  class << self
    extend Forwardable

    def_delegators :configuration, :supported_currency?, :supported_currencies

    attr_reader :configuration

    def configure
      yield(configuration)
    end

    def reset_configuration
      @configuration = Configuration.new
    end
  end
end

StrictMoney.reset_configuration

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
strict_money-0.3.0 lib/strict_money.rb
strict_money-0.2.0 lib/strict_money.rb