Module: Cucumber::Core::Ast::HasLocation

Instance Method Summary collapse

Instance Method Details

#all_locationsObject



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

#attributesObject



162
163
164
# File 'lib/cucumber/core/ast/location.rb', line 162

def attributes
  [tags, comments, multiline_arg].flatten
end

#commentsObject



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

#fileObject



145
146
147
# File 'lib/cucumber/core/ast/location.rb', line 145

def file
  location.file
end

#file_colon_lineObject



141
142
143
# File 'lib/cucumber/core/ast/location.rb', line 141

def file_colon_line
  location.to_s
end

#lineObject



149
150
151
# File 'lib/cucumber/core/ast/location.rb', line 149

def line
  location.line
end

#locationObject



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_argObject



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

#tagsObject



166
167
168
169
# File 'lib/cucumber/core/ast/location.rb', line 166

def tags
  # will be overriden by nodes that actually have tags
  []
end