Class: Cucumber::TagExpressions::Or

Inherits:
Object
  • Object
show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-tag-expressions-4.1.0/lib/cucumber/tag_expressions/expressions.rb

Overview

Or expression node

Instance Method Summary collapse

Constructor Details

#initialize(left, right) ⇒ Or

Returns a new instance of Or.



35
36
37
38
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-tag-expressions-4.1.0/lib/cucumber/tag_expressions/expressions.rb', line 35

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

Instance Method Details

#evaluate(variables) ⇒ Object



40
41
42
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-tag-expressions-4.1.0/lib/cucumber/tag_expressions/expressions.rb', line 40

def evaluate(variables)
  @left.evaluate(variables) || @right.evaluate(variables)
end

#to_sObject



44
45
46
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-tag-expressions-4.1.0/lib/cucumber/tag_expressions/expressions.rb', line 44

def to_s
  "( #{@left} or #{@right} )"
end