Exception: Plurimath::Math::ParseOptionError
- Defined in:
- lib/plurimath/errors/parse_option_error.rb
Class Method Summary collapse
- .be_verb(options) ⇒ Object
- .format_options(options) ⇒ Object
- .option_label(options) ⇒ Object
- .unknown_options(options, supported_options:) ⇒ Object
- .unsupported_options(type, options, supported_types:) ⇒ Object
Class Method Details
.be_verb(options) ⇒ Object
25 26 27 |
# File 'lib/plurimath/errors/parse_option_error.rb', line 25 def self.be_verb() .one? ? "is" : "are" end |
.format_options(options) ⇒ Object
29 30 31 |
# File 'lib/plurimath/errors/parse_option_error.rb', line 29 def self.() .map(&:inspect).join(", ") end |
.option_label(options) ⇒ Object
21 22 23 |
# File 'lib/plurimath/errors/parse_option_error.rb', line 21 def self.option_label() .one? ? "option" : "options" end |
.unknown_options(options, supported_options:) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/plurimath/errors/parse_option_error.rb', line 6 def self.(, supported_options:) new( "unknown parse #{option_label()}: #{()}; " \ "supported parse options are #{()}", ) end |
.unsupported_options(type, options, supported_types:) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/plurimath/errors/parse_option_error.rb', line 13 def self.(type, , supported_types:) new( "parse #{option_label()} #{()} " \ "#{be_verb()} not supported for #{type.inspect}; " \ "supported input types are #{(supported_types)}", ) end |