Class: MoneyAttribute::Current

Inherits:
ActiveSupport::CurrentAttributes
  • Object
show all
Defined in:
lib/money_attribute/current.rb

Overview

Per-request currency container. Set MoneyAttribute::Current.currency in your controller (or a before_action) to override the configured default for that request. Automatically reset after each request by MoneyAttribute::Middleware.

Instance Method Summary collapse

Instance Method Details

#currencyString?

Returns per-request ISO 4217 currency code override.

Returns:

  • (String, nil)

    per-request ISO 4217 currency code override.



11
# File 'lib/money_attribute/current.rb', line 11

attribute :currency