Exception: Moxml::XPath::NodeTypeError
- Inherits:
-
Error
- Object
- StandardError
- Error
- Moxml::XPathError
- Error
- Moxml::XPath::NodeTypeError
- Defined in:
- lib/moxml/xpath/errors.rb
Overview
Error raised when an XPath operation on unsupported node type
Instance Attribute Summary collapse
-
#node_type ⇒ Object
readonly
Returns the value of attribute node_type.
-
#operation ⇒ Object
readonly
Returns the value of attribute operation.
Attributes inherited from Moxml::XPathError
Instance Method Summary collapse
-
#initialize(message, expression: nil, node_type: nil, operation: nil) ⇒ NodeTypeError
constructor
A new instance of NodeTypeError.
- #to_s ⇒ Object
Constructor Details
#initialize(message, expression: nil, node_type: nil, operation: nil) ⇒ NodeTypeError
Returns a new instance of NodeTypeError.
68 69 70 71 72 |
# File 'lib/moxml/xpath/errors.rb', line 68 def initialize(, expression: nil, node_type: nil, operation: nil) @node_type = node_type @operation = operation super(, expression: expression) end |
Instance Attribute Details
#node_type ⇒ Object (readonly)
Returns the value of attribute node_type.
66 67 68 |
# File 'lib/moxml/xpath/errors.rb', line 66 def node_type @node_type end |
#operation ⇒ Object (readonly)
Returns the value of attribute operation.
66 67 68 |
# File 'lib/moxml/xpath/errors.rb', line 66 def operation @operation end |
Instance Method Details
#to_s ⇒ Object
74 75 76 77 78 79 |
# File 'lib/moxml/xpath/errors.rb', line 74 def to_s msg = super msg += "\n Node type: #{@node_type}" if @node_type msg += "\n Operation: #{@operation}" if @operation msg end |