Exception: Moxml::XPath::FunctionError

Inherits:
Error show all
Defined in:
lib/moxml/xpath/errors.rb

Overview

Error raised when an XPath function is not found or invalid

Instance Attribute Summary collapse

Attributes inherited from Moxml::XPathError

#adapter, #expression, #node

Instance Method Summary collapse

Constructor Details

#initialize(message, expression: nil, function_name: nil, argument_count: nil) ⇒ FunctionError

Returns a new instance of FunctionError.



49
50
51
52
53
54
# File 'lib/moxml/xpath/errors.rb', line 49

def initialize(message, expression: nil, function_name: nil,
argument_count: nil)
  @function_name = function_name
  @argument_count = argument_count
  super(message, expression: expression)
end

Instance Attribute Details

#argument_countObject (readonly)

Returns the value of attribute argument_count.



47
48
49
# File 'lib/moxml/xpath/errors.rb', line 47

def argument_count
  @argument_count
end

#function_nameObject (readonly)

Returns the value of attribute function_name.



47
48
49
# File 'lib/moxml/xpath/errors.rb', line 47

def function_name
  @function_name
end

Instance Method Details

#to_sObject



56
57
58
59
60
61
# File 'lib/moxml/xpath/errors.rb', line 56

def to_s
  msg = super
  msg += "\n  Function: #{@function_name}" if @function_name
  msg += "\n  Arguments: #{@argument_count}" if @argument_count
  msg
end