Class: Gherkin::Parser::Sexp
Instance Method Summary collapse
- #event ⇒ Object
-
#initialize(*args) ⇒ Sexp
constructor
A new instance of Sexp.
- #keyword ⇒ Object
- #line_match?(lines) ⇒ Boolean
- #name_match?(name_regexen) ⇒ Boolean
- #replay(listener) ⇒ Object
Methods inherited from Array
Constructor Details
#initialize(*args) ⇒ Sexp
Returns a new instance of Sexp.
4 5 6 7 |
# File 'lib/gherkin/parser/sexp.rb', line 4 def initialize(*args) super self[1] = self[1].to_a if event == :row # Special JRuby handling end |
Instance Method Details
#event ⇒ Object
9 10 11 |
# File 'lib/gherkin/parser/sexp.rb', line 9 def event self[0] end |
#keyword ⇒ Object
13 14 15 |
# File 'lib/gherkin/parser/sexp.rb', line 13 def keyword self[1] end |
#line_match?(lines) ⇒ Boolean
17 18 19 |
# File 'lib/gherkin/parser/sexp.rb', line 17 def line_match?(lines) lines.include?(line) end |
#name_match?(name_regexen) ⇒ Boolean
21 22 23 24 |
# File 'lib/gherkin/parser/sexp.rb', line 21 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) ⇒ Object
26 27 28 |
# File 'lib/gherkin/parser/sexp.rb', line 26 def replay(listener) listener.__send__(event, *args) end |