Module: Cucumber::Core::Ast::HasLocation
- Included in:
- Background, Comment, DataTable, DocString, ExamplesTable, ExamplesTable::Header, ExamplesTable::Row, Feature, OutlineStep, Scenario, ScenarioOutline, Step, Tag
- Defined in:
- lib/cucumber/core/ast/location.rb
Instance Method Summary collapse
- #attributes ⇒ Object
- #comments ⇒ Object
- #file ⇒ Object
- #file_colon_line ⇒ Object
- #line ⇒ Object
- #location ⇒ Object
- #match_locations?(queried_locations) ⇒ Boolean
- #multiline_arg ⇒ Object
- #tags ⇒ Object
Instance Method Details
#attributes ⇒ Object
120 121 122 |
# File 'lib/cucumber/core/ast/location.rb', line 120 def attributes [, comments, multiline_arg].flatten end |
#comments ⇒ Object
129 130 131 132 |
# File 'lib/cucumber/core/ast/location.rb', line 129 def comments # will be overriden by nodes that actually have comments [] end |
#file ⇒ Object
102 103 104 |
# File 'lib/cucumber/core/ast/location.rb', line 102 def file location.file end |
#file_colon_line ⇒ Object
98 99 100 |
# File 'lib/cucumber/core/ast/location.rb', line 98 def file_colon_line location.to_s end |
#line ⇒ Object
106 107 108 |
# File 'lib/cucumber/core/ast/location.rb', line 106 def line location.line end |
#location ⇒ Object
110 111 112 113 |
# File 'lib/cucumber/core/ast/location.rb', line 110 def location raise('Please set @location in the constructor') unless defined?(@location) @location end |
#match_locations?(queried_locations) ⇒ Boolean
115 116 117 118 |
# File 'lib/cucumber/core/ast/location.rb', line 115 def match_locations?(queried_locations) return true if attributes.any? { |node| node.match_locations? queried_locations } queried_locations.any? { |queried_location| queried_location.match? location } end |
#multiline_arg ⇒ Object
134 135 136 137 |
# File 'lib/cucumber/core/ast/location.rb', line 134 def multiline_arg # will be overriden by nodes that actually have a multiline_argument EmptyMultilineArgument.new end |
#tags ⇒ Object
124 125 126 127 |
# File 'lib/cucumber/core/ast/location.rb', line 124 def # will be overriden by nodes that actually have tags [] end |