### Home Classes Methods

### In Files

- lib/gherkin/parser/tag_expression.rb

### Parent

Object

### Methods

- ::new
- #empty?
- #eval

### Files

- LICENSE
- README.rdoc
- meta.txt
- root.txt
- steps.txt
- README.rdoc

### Class/Module Index

Quicksearch

- Gherkin
- Gherkin::CLexer
- Gherkin::Cli
- Gherkin::Cli::Main
- Gherkin::Formatter
- Gherkin::Formatter::Argument
- Gherkin::Formatter::Colors
- Gherkin::Formatter::Escaping
- Gherkin::Formatter::JSONFormatter
- Gherkin::Formatter::MonochromeFormat
- Gherkin::Formatter::PrettyFormatter
- Gherkin::I18n
- Gherkin::I18nLexer
- Gherkin::JSONLexer
- Gherkin::Parser
- Gherkin::Parser::Event
- Gherkin::Parser::FilterListener
- Gherkin::Parser::FormatterListener
- Gherkin::Parser::ParseError
- Gherkin::Parser::Parser
- Gherkin::Parser::Parser::Machine
- Gherkin::Parser::Parser::Machine::StateMachineReader
- Gherkin::Parser::Row
- Gherkin::Parser::TagExpression
- Gherkin::RbLexer
- Gherkin::Rubify
- Gherkin::Tools
- Gherkin::Tools::Files
- Gherkin::Tools::Reformat
- Gherkin::Tools::Stats
- Gherkin::Tools::StatsListener
- Class

No matching classes.

# Gherkin::Parser::TagExpression

### Attributes

limits[R]

### Public Class Methods

new(tag_expressions) click to toggle source

    # File lib/gherkin/parser/tag_expression.rb, line 10
    def initialize(tag_expressions)
      @ands = []
      @limits = {}
      tag_expressions.each do |expr|
        add(expr.strip.split(/\s*,\s*/))
      end
    end

### Public Instance Methods

empty?() click to toggle source

    # File lib/gherkin/parser/tag_expression.rb, line 18
    def empty?
      @ands.empty?
    end

eval(tags) click to toggle source

    # File lib/gherkin/parser/tag_expression.rb, line 22
    def eval(tags)
      return true if @ands.flatten.empty?
      vars = Hash[*tags.map{|tag| [tag, true]}.flatten]
      !!Kernel.eval(ruby_expression)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.