class Gammo::XPath::AST::Function

Class for representing XPath core function library. www.w3.org/TR/1999/REC-xpath-19991116/#corelib

Attributes

arguments[R]

Public Class Methods

new(*arguments) click to toggle source

@!visibility private

# File lib/gammo/xpath/ast/function.rb, line 13
def initialize(*arguments)
  @arguments = arguments
end

Public Instance Methods

evaluate(context) click to toggle source

@!visibility private

# File lib/gammo/xpath/ast/function.rb, line 18
def evaluate(context)
  raise NotImplementedError, '#evaluate must be implemented'
end

Private Instance Methods

bool(val) click to toggle source

@!visibility private

# File lib/gammo/xpath/ast/function.rb, line 31
def bool(val)
  return val if val.instance_of?(Value::Boolean)
  Value::Boolean.new(val)
end
number(val) click to toggle source

@!visibility private

# File lib/gammo/xpath/ast/function.rb, line 25
def number(val)
  return val if val.instance_of?(Value::Number)
  Value::Number.new(val)
end
string(val) click to toggle source

@!visibility private

# File lib/gammo/xpath/ast/function.rb, line 37
def string(val)
  return val if val.instance_of?(Value::String)
  Value::String.new(val)
end