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
- #all_locations ⇒ Object
- #attributes ⇒ Object
- #comments ⇒ Object
- #file ⇒ Object
- #file_colon_line ⇒ Object
- #line ⇒ Object
- #location ⇒ Object
- #multiline_arg ⇒ Object
- #tags ⇒ Object
Instance Method Details
#all_locations ⇒ Object
158 159 160 |
# File 'lib/cucumber/core/ast/location.rb', line 158 def all_locations @all_locations ||= Location.merge([location] + attributes.map { |node| node.all_locations }.flatten) end |
#attributes ⇒ Object
162 163 164 |
# File 'lib/cucumber/core/ast/location.rb', line 162 def attributes [, comments, multiline_arg].flatten end |
#comments ⇒ Object
171 172 173 174 |
# File 'lib/cucumber/core/ast/location.rb', line 171 def comments # will be overriden by nodes that actually have comments [] end |
#file ⇒ Object
145 146 147 |
# File 'lib/cucumber/core/ast/location.rb', line 145 def file location.file end |
#file_colon_line ⇒ Object
141 142 143 |
# File 'lib/cucumber/core/ast/location.rb', line 141 def file_colon_line location.to_s end |
#line ⇒ Object
149 150 151 |
# File 'lib/cucumber/core/ast/location.rb', line 149 def line location.line end |
#location ⇒ Object
153 154 155 156 |
# File 'lib/cucumber/core/ast/location.rb', line 153 def location raise('Please set @location in the constructor') unless defined?(@location) @location end |
#multiline_arg ⇒ Object
176 177 178 179 |
# File 'lib/cucumber/core/ast/location.rb', line 176 def multiline_arg # will be overriden by nodes that actually have a multiline_argument EmptyMultilineArgument.new end |
#tags ⇒ Object
166 167 168 169 |
# File 'lib/cucumber/core/ast/location.rb', line 166 def # will be overriden by nodes that actually have tags [] end |