Exception: Plurimath::ConfigurationError

Inherits:
Error
  • Object
show all
Defined in:
lib/plurimath/errors/configuration_error.rb

Instance Method Summary collapse

Constructor Details

#initialize(type, value: nil, supported: nil) ⇒ ConfigurationError

Returns a new instance of ConfigurationError.



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

def initialize(type, value: nil, supported: nil)
  @type = type
  @value = value
  @supported = supported
  super(message)
end

Instance Method Details

#messageObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/plurimath/errors/configuration_error.rb', line 12

def message
  case @type
  when :unsupported_deprecation_behavior
    "unsupported deprecation behavior: #{@value.inspect}; " \
    "expected one of #{@supported.inspect}"
  when :missing_deprecation_feature
    "deprecation feature must be provided"
  when :conflicting_formatter_options
    "formatter options cannot be used together: choose either " \
    ":padding_digits or :padding_group_digits"
  else
    "invalid Plurimath configuration"
  end
end