### Home Classes Methods

### In Files

- lib/gherkin/parser/event.rb

### Parent

Array

### Methods

- #event
- #keyword
- #line_match?
- #name_match?
- #replay

### 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::Event

### Public Instance Methods

event() click to toggle source

    # File lib/gherkin/parser/event.rb, line 4
    def event
      self[0]
    end

keyword() click to toggle source

    # File lib/gherkin/parser/event.rb, line 8
    def keyword
      self[1]
    end

line_match?(lines) click to toggle source

    # File lib/gherkin/parser/event.rb, line 12
    def line_match?(lines)
      lines.include?(line)
    end

name_match?(name_regexen) click to toggle source

    # File lib/gherkin/parser/event.rb, line 16
    def name_match?(name_regexen)
      return false unless [:feature, :background, :scenario, :scenario_outline, :examples].include?(event)
      name_regexen.detect{|name_regex| name =~ name_regex}
    end

replay(listener) click to toggle source

    # File lib/gherkin/parser/event.rb, line 21
    def replay(listener)
      begin
        listener.__send__(event, *args)
      rescue ArgumentError => e
        e.message << "\nListener: #{listener.class}, args: #{args.inspect}"
        raise e
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.