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

Instance Method Summary collapse

Instance Method Details

#all_locationsObject



157
158
159
# File 'lib/cucumber/core/ast/location.rb', line 157

def all_locations
  @all_locations ||= Location.merge([location] + attributes.map { |node| node.all_locations }.flatten)
end

#attributesObject



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

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

#commentsObject



170
171
172
173
# File 'lib/cucumber/core/ast/location.rb', line 170

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

#fileObject



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

def file
  location.file
end

#file_colon_lineObject



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

def file_colon_line
  location.to_s
end

#lineObject



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

def line
  location.line
end

#locationObject



152
153
154
155
# File 'lib/cucumber/core/ast/location.rb', line 152

def location
  raise('Please set @location in the constructor') unless defined?(@location)
  @location
end

#multiline_argObject



175
176
177
178
# File 'lib/cucumber/core/ast/location.rb', line 175

def multiline_arg
  # will be overriden by nodes that actually have a multiline_argument
  EmptyMultilineArgument.new
end

#tagsObject



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

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