Module: Bankroll::Types

Defined in:
lib/bankroll/types.rb

Constant Summary collapse

Constructor =
Dry::Types::Constructor
ConvertToDecimal =
lambda do |value|
  return value if value.is_a? Bankroll::Decimal

  Bankroll::Decimal[value.to_s]
end

Class Method Summary collapse

Class Method Details

.[](key) ⇒ Object



9
10
11
# File 'lib/bankroll/types.rb', line 9

def self.[](key)
  Dry::Types[key]
end

.register(key, value) ⇒ Object



13
14
15
# File 'lib/bankroll/types.rb', line 13

def self.register(key, value)
  Dry::Types.register(key, value)
end