Class: Cucumber::TagExpressions::Literal
- Inherits:
-
Object
- Object
- Cucumber::TagExpressions::Literal
- Defined in:
- lib/cucumber/tag_expressions/expressions.rb
Overview
Literal expression node
Instance Method Summary collapse
- #evaluate(variables) ⇒ Object
-
#initialize(value) ⇒ Literal
constructor
A new instance of Literal.
- #to_s ⇒ Object
Constructor Details
#initialize(value) ⇒ Literal
Returns a new instance of Literal.
7 8 9 |
# File 'lib/cucumber/tag_expressions/expressions.rb', line 7 def initialize(value) @value = value end |
Instance Method Details
#evaluate(variables) ⇒ Object
11 12 13 |
# File 'lib/cucumber/tag_expressions/expressions.rb', line 11 def evaluate(variables) variables.include?(@value) end |
#to_s ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/cucumber/tag_expressions/expressions.rb', line 15 def to_s @value .gsub(/\\/, '\\\\\\\\') .gsub(/\(/, '\\(') .gsub(/\)/, '\\)') .gsub(/\s/, '\\ ') end |