Exception: Moxml::XPath::InvalidContextError
- Inherits:
-
Error
- Object
- StandardError
- Error
- Moxml::XPathError
- Error
- Moxml::XPath::InvalidContextError
- Defined in:
- lib/moxml/xpath/errors.rb
Overview
Error raised when an XPath function is called without required context
Instance Attribute Summary collapse
-
#function_name ⇒ Object
readonly
Returns the value of attribute function_name.
-
#required_context ⇒ Object
readonly
Returns the value of attribute required_context.
Attributes inherited from Moxml::XPathError
Instance Method Summary collapse
-
#initialize(message, expression: nil, function_name: nil, required_context: nil) ⇒ InvalidContextError
constructor
A new instance of InvalidContextError.
- #to_s ⇒ Object
Constructor Details
#initialize(message, expression: nil, function_name: nil, required_context: nil) ⇒ InvalidContextError
Returns a new instance of InvalidContextError.
86 87 88 89 90 91 |
# File 'lib/moxml/xpath/errors.rb', line 86 def initialize(, expression: nil, function_name: nil, required_context: nil) @function_name = function_name @required_context = required_context super(, expression: expression) end |
Instance Attribute Details
#function_name ⇒ Object (readonly)
Returns the value of attribute function_name.
84 85 86 |
# File 'lib/moxml/xpath/errors.rb', line 84 def function_name @function_name end |
#required_context ⇒ Object (readonly)
Returns the value of attribute required_context.
84 85 86 |
# File 'lib/moxml/xpath/errors.rb', line 84 def required_context @required_context end |
Instance Method Details
#to_s ⇒ Object
93 94 95 96 97 98 |
# File 'lib/moxml/xpath/errors.rb', line 93 def to_s msg = super msg += "\n Function: #{@function_name}" if @function_name msg += "\n Required context: #{@required_context}" if @required_context msg end |