Class: Ldpath::OrTest

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) ⇒ OrTest

Returns a new instance of OrTest.



63
64
65
66
# File 'lib/ldpath/tests.rb', line 63

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

Instance Attribute Details

#leftObject (readonly)

Returns the value of attribute left.



61
62
63
# File 'lib/ldpath/tests.rb', line 61

def left
  @left
end

#rightObject (readonly)

Returns the value of attribute right.



61
62
63
# File 'lib/ldpath/tests.rb', line 61

def right
  @right
end

Instance Method Details

#evaluate(program, uri, context) ⇒ Object



68
69
70
# File 'lib/ldpath/tests.rb', line 68

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