Exception: Plurimath::Errors::UnsupportedBase

Inherits:
Plurimath::Error show all
Defined in:
lib/plurimath/errors/unsupported_base.rb

Instance Method Summary collapse

Constructor Details

#initialize(base, supported_bases) ⇒ UnsupportedBase

Returns a new instance of UnsupportedBase.



6
7
8
9
10
# File 'lib/plurimath/errors/unsupported_base.rb', line 6

def initialize(base, supported_bases)
  @base = base
  @supported = supported_bases.keys.join(", ")
  super(message)
end

Instance Method Details

#messageObject



12
13
14
15
# File 'lib/plurimath/errors/unsupported_base.rb', line 12

def message
  "[plurimath] Unsupported base `#{@base}` for number formatting. " \
    "[plurimath] The formatter `:base` option must be one of: #{@supported}."
end