Class: Cucumber::Parser::Filter
- Defined in:
- lib/cucumber/parser/treetop_ext.rb
Instance Method Summary collapse
- #accept?(syntax_node) ⇒ Boolean
- #at_line?(syntax_node) ⇒ Boolean
- #excluded_by_tags?(syntax_node) ⇒ Boolean
- #included_by_tags?(syntax_node) ⇒ Boolean
-
#initialize(lines, options) ⇒ Filter
constructor
A new instance of Filter.
- #matches_names?(syntax_node) ⇒ Boolean
- #matches_tags?(syntax_node) ⇒ Boolean
- #outline_at_line?(syntax_node) ⇒ Boolean
Constructor Details
#initialize(lines, options) ⇒ Filter
Returns a new instance of Filter.
16 17 18 19 20 21 |
# File 'lib/cucumber/parser/treetop_ext.rb', line 16 def initialize(lines, ) @lines = lines @include_tags = [:include_tags] || [] @exclude_tags = [:exclude_tags] || [] @names = [:scenario_names] || [] end |
Instance Method Details
#accept?(syntax_node) ⇒ Boolean
23 24 25 26 27 |
# File 'lib/cucumber/parser/treetop_ext.rb', line 23 def accept?(syntax_node) at_line?(syntax_node) && (syntax_node) && matches_names?(syntax_node) end |
#at_line?(syntax_node) ⇒ Boolean
29 30 31 |
# File 'lib/cucumber/parser/treetop_ext.rb', line 29 def at_line?(syntax_node) @lines.nil? || @lines.empty? || @lines.detect{|line| syntax_node.at_line?(line)} end |
#excluded_by_tags?(syntax_node) ⇒ Boolean
46 47 48 |
# File 'lib/cucumber/parser/treetop_ext.rb', line 46 def (syntax_node) @exclude_tags.any? && syntax_node.(@exclude_tags) end |
#included_by_tags?(syntax_node) ⇒ Boolean
42 43 44 |
# File 'lib/cucumber/parser/treetop_ext.rb', line 42 def (syntax_node) @include_tags.empty? || syntax_node.(@include_tags) end |
#matches_names?(syntax_node) ⇒ Boolean
50 51 52 |
# File 'lib/cucumber/parser/treetop_ext.rb', line 50 def matches_names?(syntax_node) @names.nil? || @names.empty? || @names.detect{|name| syntax_node.matches_name?(name)} end |
#matches_tags?(syntax_node) ⇒ Boolean
37 38 39 40 |
# File 'lib/cucumber/parser/treetop_ext.rb', line 37 def (syntax_node) !(syntax_node) && (syntax_node) end |
#outline_at_line?(syntax_node) ⇒ Boolean
33 34 35 |
# File 'lib/cucumber/parser/treetop_ext.rb', line 33 def outline_at_line?(syntax_node) @lines.nil? || @lines.empty? || @lines.detect{|line| syntax_node.outline_at_line?(line)} end |