Exception: Succubus::ExecuteError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Succubus::ExecuteError
- Defined in:
- lib/succubus.rb
Overview
Raised by Grammar#execute if the Generator encountered any errors while executing the grammar.
Instance Attribute Summary collapse
-
#errors ⇒ Array<String>
readonly
The errors encountered during execution.
-
#partial ⇒ Result
readonly
As much of the result as the Generator was able to produce.
Instance Method Summary collapse
Instance Attribute Details
#errors ⇒ Array<String> (readonly)
Returns the errors encountered during execution.
30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/succubus.rb', line 30 class ExecuteError < RuntimeError attr_reader :errors, :partial # @private def set_errors(errors) @errors = errors end # @private def set_partial(partial) @partial = partial end end |
#partial ⇒ Result (readonly)
Returns as much of the result as the Generator was able to produce. Typically, this will be a string with missing rules surrounded by !!missing!!. For instance, “My !!pet!! is nice”.
30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/succubus.rb', line 30 class ExecuteError < RuntimeError attr_reader :errors, :partial # @private def set_errors(errors) @errors = errors end # @private def set_partial(partial) @partial = partial end end |
Instance Method Details
#set_errors(errors) ⇒ Object
34 35 36 |
# File 'lib/succubus.rb', line 34 def set_errors(errors) @errors = errors end |
#set_partial(partial) ⇒ Object
39 40 41 |
# File 'lib/succubus.rb', line 39 def set_partial(partial) @partial = partial end |