Exception: Enolib::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Enolib::Error
- Defined in:
- lib/enolib/errors.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#selection ⇒ Object
readonly
Returns the value of attribute selection.
-
#snippet ⇒ Object
readonly
Returns the value of attribute snippet.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
- #cursor ⇒ Object
-
#initialize(text, snippet, selection) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(text, snippet, selection) ⇒ Error
Returns a new instance of Error.
7 8 9 10 11 12 13 |
# File 'lib/enolib/errors.rb', line 7 def initialize(text, snippet, selection) super("#{text}\n\n#{snippet}") @selection = selection @snippet = snippet @text = text end |
Instance Attribute Details
#selection ⇒ Object (readonly)
Returns the value of attribute selection.
5 6 7 |
# File 'lib/enolib/errors.rb', line 5 def selection @selection end |
#snippet ⇒ Object (readonly)
Returns the value of attribute snippet.
5 6 7 |
# File 'lib/enolib/errors.rb', line 5 def snippet @snippet end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
5 6 7 |
# File 'lib/enolib/errors.rb', line 5 def text @text end |
Instance Method Details
#cursor ⇒ Object
15 16 17 |
# File 'lib/enolib/errors.rb', line 15 def cursor @selection[0] end |