Exception: SearchSyntax::UnknownParamError
- Inherits:
-
StandardError
- Object
- StandardError
- SearchSyntax::UnknownParamError
- Defined in:
- lib/search_syntax/errors.rb
Instance Attribute Summary collapse
-
#did_you_mean ⇒ Object
readonly
Returns the value of attribute did_you_mean.
-
#finish ⇒ Object
readonly
Returns the value of attribute finish.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#start ⇒ Object
readonly
Returns the value of attribute start.
Instance Method Summary collapse
-
#initialize(name:, start:, finish:, did_you_mean:) ⇒ UnknownParamError
constructor
A new instance of UnknownParamError.
Constructor Details
#initialize(name:, start:, finish:, did_you_mean:) ⇒ UnknownParamError
Returns a new instance of UnknownParamError.
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/search_syntax/errors.rb', line 19 def initialize(name:, start:, finish:, did_you_mean:) @name = name @start = start @finish = finish @did_you_mean = did_you_mean = "Unknown parameter '#{name}' at position #{start}." if did_you_mean[0] += " Did you mean '#{did_you_mean[0]}'?" end super() end |
Instance Attribute Details
#did_you_mean ⇒ Object (readonly)
Returns the value of attribute did_you_mean.
17 18 19 |
# File 'lib/search_syntax/errors.rb', line 17 def did_you_mean @did_you_mean end |
#finish ⇒ Object (readonly)
Returns the value of attribute finish.
17 18 19 |
# File 'lib/search_syntax/errors.rb', line 17 def finish @finish end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
17 18 19 |
# File 'lib/search_syntax/errors.rb', line 17 def name @name end |
#start ⇒ Object (readonly)
Returns the value of attribute start.
17 18 19 |
# File 'lib/search_syntax/errors.rb', line 17 def start @start end |