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
142 143 144 |
# File 'lib/cucumber/core/ast/location.rb', line 142 def attributes [, comments, multiline_arg].flatten end |
#comments ⇒ Object
151 152 153 154 |
# File 'lib/cucumber/core/ast/location.rb', line 151 def comments # will be overriden by nodes that actually have comments [] end |
#file ⇒ Object
124 125 126 |
# File 'lib/cucumber/core/ast/location.rb', line 124 def file location.file end |
#file_colon_line ⇒ Object
120 121 122 |
# File 'lib/cucumber/core/ast/location.rb', line 120 def file_colon_line location.to_s end |
#line ⇒ Object
128 129 130 |
# File 'lib/cucumber/core/ast/location.rb', line 128 def line location.line end |
#location ⇒ Object
132 133 134 135 |
# File 'lib/cucumber/core/ast/location.rb', line 132 def location raise('Please set @location in the constructor') unless defined?(@location) @location end |
#match_locations?(queried_locations) ⇒ Boolean
137 138 139 140 |
# File 'lib/cucumber/core/ast/location.rb', line 137 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
156 157 158 159 |
# File 'lib/cucumber/core/ast/location.rb', line 156 def multiline_arg # will be overriden by nodes that actually have a multiline_argument EmptyMultilineArgument.new end |
#tags ⇒ Object
146 147 148 149 |
# File 'lib/cucumber/core/ast/location.rb', line 146 def # will be overriden by nodes that actually have tags [] end |