Exception: Moxml::XPath::EvaluationError
- Inherits:
-
Error
- Object
- StandardError
- Error
- Moxml::XPathError
- Error
- Moxml::XPath::EvaluationError
- Defined in:
- lib/moxml/xpath/errors.rb
Overview
Error raised when XPath evaluation fails
Instance Attribute Summary collapse
-
#context_node ⇒ Object
readonly
Returns the value of attribute context_node.
-
#step ⇒ Object
readonly
Returns the value of attribute step.
Attributes inherited from Moxml::XPathError
Instance Method Summary collapse
-
#initialize(message, expression: nil, context_node: nil, step: nil) ⇒ EvaluationError
constructor
A new instance of EvaluationError.
- #to_s ⇒ Object
Constructor Details
#initialize(message, expression: nil, context_node: nil, step: nil) ⇒ EvaluationError
Returns a new instance of EvaluationError.
31 32 33 34 35 |
# File 'lib/moxml/xpath/errors.rb', line 31 def initialize(, expression: nil, context_node: nil, step: nil) @context_node = context_node @step = step super(, expression: expression) end |
Instance Attribute Details
#context_node ⇒ Object (readonly)
Returns the value of attribute context_node.
29 30 31 |
# File 'lib/moxml/xpath/errors.rb', line 29 def context_node @context_node end |
#step ⇒ Object (readonly)
Returns the value of attribute step.
29 30 31 |
# File 'lib/moxml/xpath/errors.rb', line 29 def step @step end |
Instance Method Details
#to_s ⇒ Object
37 38 39 40 41 42 |
# File 'lib/moxml/xpath/errors.rb', line 37 def to_s msg = super msg += "\n Context node: <#{@context_node.name}>" if @context_node.respond_to?(:name) msg += "\n Step: #{@step}" if @step msg end |