class Money::Context

Overview

Context class holding global settings for Money objects. Each Fiber has its own Fiber#money_context instance.

See also Money.same_context_wrapper and Money.spawn_with_same_context.

Defined in:

money/context.cr

Instance Method Summary

Instance Method Detail

def default_bank : Bank #

Each Money object is associated to a bank object, which is responsible for currency exchange. This property allows you to specify the default bank object. The default value for this property is an instance of Bank::VariableExchange, which allows one to specify custom exchange rates.


[View source]
def default_bank=(default_bank : Bank) #

Each Money object is associated to a bank object, which is responsible for currency exchange. This property allows you to specify the default bank object. The default value for this property is an instance of Bank::VariableExchange, which allows one to specify custom exchange rates.


[View source]
def default_currency : Currency #

Default currency for creating new Money object.


[View source]
def default_currency=(currency_code : String | Symbol) #

Default currency for creating new Money object.


[View source]
def default_currency=(default_currency : Currency) #

Default currency for creating new Money object.


[View source]
def default_rate_store : Currency::RateStore #

Default currency rate store used by Bank objects. It defaults to using an in-memory, concurrency-safe, store instance for storing exchange rates.


[View source]
def default_rate_store=(default_rate_store : Currency::RateStore) #

Default currency rate store used by Bank objects. It defaults to using an in-memory, concurrency-safe, store instance for storing exchange rates.


[View source]
def infinite_precision=(infinite_precision : Bool) #

Use this to control infinite precision cents.


[View source]
def infinite_precision? : Bool #

Use this to control infinite precision cents.


[View source]
def rounding_mode : Number::RoundingMode #

Default rounding mode.


[View source]
def rounding_mode=(rounding_mode : Number::RoundingMode) #

Default rounding mode.


[View source]