class Gammo::XPath::AST::BinaryExpr

Class for representing a binary expression. @!visibility private

Public Class Methods

new(a, b) click to toggle source

Constructs a binary expression by given “a” and “b”. @param [Gammo::AST::Value, Gammo::AST:NodeSet] a @param [Gammo::AST::Value, Gammo::AST:NodeSet] b @!visibility private

# File lib/gammo/xpath/ast/expression.rb, line 13
def initialize(a, b)
  @a = a
  @b = b
end

Public Instance Methods

evaluate(context) click to toggle source

@!visibility private

# File lib/gammo/xpath/ast/expression.rb, line 19
def evaluate(context)
  raise NotImplementedError, "BinaryExpr#evaluate must be implemented"
end

Private Instance Methods

evaluate_values(context) click to toggle source

@return [Array<Gammo::AST::Value…>] @!visibility private

# File lib/gammo/xpath/ast/expression.rb, line 27
def evaluate_values(context)
  [@a.evaluate(context), @b.evaluate(context.dup)]
end