Exception: Plurimath::Formatter::UnsupportedBase
- Inherits:
-
StandardError
- Object
- StandardError
- Plurimath::Formatter::UnsupportedBase
- Defined in:
- lib/plurimath/errors/formatter/unsupported_base.rb
Instance Method Summary collapse
-
#initialize(base, supported_bases) ⇒ UnsupportedBase
constructor
A new instance of UnsupportedBase.
- #to_s ⇒ Object
Constructor Details
#initialize(base, supported_bases) ⇒ UnsupportedBase
Returns a new instance of UnsupportedBase.
6 7 8 9 |
# File 'lib/plurimath/errors/formatter/unsupported_base.rb', line 6 def initialize(base, supported_bases) @base = base @supported = supported_bases.keys.map { |key| key.to_s.inspect }.join(", ") end |
Instance Method Details
#to_s ⇒ Object
11 12 13 14 15 16 |
# File 'lib/plurimath/errors/formatter/unsupported_base.rb', line 11 def to_s <<~MESSAGE [plurimath] Unsupported base `#{@base}` for number formatting. [plurimath] The formatter `:base` option must be one of: #{@supported}. MESSAGE end |