Exception: CSVPlusPlus::Error::ModifierSyntaxError
- Extended by:
- T::Sig
- Includes:
- PositionalError
- Defined in:
- lib/csv_plus_plus/error/modifier_syntax_error.rb
Overview
A syntax error encountered when parsing a modifier definition
Direct Known Subclasses
Instance Attribute Summary collapse
-
#bad_input ⇒ Object
readonly
Returns the value of attribute bad_input.
-
#modifier ⇒ Object
readonly
Returns the value of attribute modifier.
Attributes inherited from Error
Instance Method Summary collapse
-
#error_message ⇒ ::String
Create a relevant error message given @choices or @message (one of them must be supplied).
-
#initialize(message, bad_input:, modifier: nil, wrapped_error: nil) ⇒ ModifierSyntaxError
constructor
A new instance of ModifierSyntaxError.
Constructor Details
#initialize(message, bad_input:, modifier: nil, wrapped_error: nil) ⇒ ModifierSyntaxError
Returns a new instance of ModifierSyntaxError.
29 30 31 32 33 34 |
# File 'lib/csv_plus_plus/error/modifier_syntax_error.rb', line 29 def initialize(, bad_input:, modifier: nil, wrapped_error: nil) super(, wrapped_error:) @bad_input = bad_input @modifier = modifier end |
Instance Attribute Details
#bad_input ⇒ Object (readonly)
Returns the value of attribute bad_input.
12 13 14 |
# File 'lib/csv_plus_plus/error/modifier_syntax_error.rb', line 12 def bad_input @bad_input end |
#modifier ⇒ Object (readonly)
Returns the value of attribute modifier.
15 16 17 |
# File 'lib/csv_plus_plus/error/modifier_syntax_error.rb', line 15 def modifier @modifier end |
Instance Method Details
#error_message ⇒ ::String
Create a relevant error message given @choices or @message (one of them must be supplied).
40 41 42 43 44 45 46 |
# File 'lib/csv_plus_plus/error/modifier_syntax_error.rb', line 40 def <<~ERROR_MESSAGE Error parsing modifier: [[#{@modifier}=...]] Bad input: #{@bad_input} Reason: #{@message} ERROR_MESSAGE end |