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

Instance Method Summary collapse

Instance Method Details

#attributesObject



129
130
131
# File 'lib/cucumber/core/ast/location.rb', line 129

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

#commentsObject



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

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

#fileObject



111
112
113
# File 'lib/cucumber/core/ast/location.rb', line 111

def file
  location.file
end

#file_colon_lineObject



107
108
109
# File 'lib/cucumber/core/ast/location.rb', line 107

def file_colon_line
  location.to_s
end

#lineObject



115
116
117
# File 'lib/cucumber/core/ast/location.rb', line 115

def line
  location.line
end

#locationObject



119
120
121
122
# File 'lib/cucumber/core/ast/location.rb', line 119

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

#match_locations?(queried_locations) ⇒ Boolean



124
125
126
127
# File 'lib/cucumber/core/ast/location.rb', line 124

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_argObject



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

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

#tagsObject



133
134
135
136
# File 'lib/cucumber/core/ast/location.rb', line 133

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