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.



78
79
80
81
# File 'lib/ldpath/tests.rb', line 78

def initialize left, right
  @left = left
  @right = right
end

Instance Attribute Details

#left ⇒ Object (readonly)

Returns the value of attribute left.



76
77
78
# File 'lib/ldpath/tests.rb', line 76

def left
  @left
end

#right ⇒ Object (readonly)

Returns the value of attribute right.



76
77
78
# File 'lib/ldpath/tests.rb', line 76

def right
  @right
end

Instance Method Details

#evaluate(program, uri, context) ⇒ Object



83
84
85
86
# File 'lib/ldpath/tests.rb', line 83

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