Class: Ldpath::AndTest

Inherits:
TestSelector show all
Defined in:
lib/ldpath/tests.rb

Instance Attribute Summary collapse

Attributes inherited from TestSelector

#delegate, #test

Instance Method Summary collapse

Methods inherited from Selector

#loading

Constructor Details

#initialize(left, right) ⇒ AndTest

Returns a new instance of AndTest.



91
92
93
94
95
96
# File 'lib/ldpath/tests.rb', line 91

def initialize(left, right)
  @left = left
  @right = right

  super
end

Instance Attribute Details

#leftObject (readonly)

Returns the value of attribute left.



89
90
91
# File 'lib/ldpath/tests.rb', line 89

def left
  @left
end

#rightObject (readonly)

Returns the value of attribute right.



89
90
91
# File 'lib/ldpath/tests.rb', line 89

def right
  @right
end

Instance Method Details

#evaluate(program, uri, context) ⇒ Object



98
99
100
101
# File 'lib/ldpath/tests.rb', line 98

def evaluate(program, uri, context)
  left.evaluate(program, uri, context).any? &&
    right.evaluate(program, uri, context).any?
end