Exception: Yay::UnexpectedTokenError
- Defined in:
- lib/yay/errors.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from Error
Instance Method Summary collapse
- #extra_message ⇒ Object
-
#initialize(type, value, position) ⇒ UnexpectedTokenError
constructor
A new instance of UnexpectedTokenError.
- #printable_message ⇒ Object
Methods inherited from Error
Constructor Details
#initialize(type, value, position) ⇒ UnexpectedTokenError
Returns a new instance of UnexpectedTokenError.
108 109 110 111 112 |
# File 'lib/yay/errors.rb', line 108 def initialize type, value, position @type = type @value = value @position = position end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
105 106 107 |
# File 'lib/yay/errors.rb', line 105 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
106 107 108 |
# File 'lib/yay/errors.rb', line 106 def value @value end |
Instance Method Details
#extra_message ⇒ Object
114 115 116 117 |
# File 'lib/yay/errors.rb', line 114 def return "Since #{value} has a special meaning, try enclosing it in quotes or a regex when searching for it" if type == "colour" return "" end |
#printable_message ⇒ Object
119 120 121 |
# File 'lib/yay/errors.rb', line 119 def return "Unexpected #{type} \"#{value}\"#{printable_position}\n#{}" end |