class FoodCritic::Review
def to_s
Returns a string representation of this review. This representation is
def to_s # Sorted by filename and line number. # # FC123: My rule name: foo/recipes/default.rb @warnings.map do |w| ["#{w.rule.code}: #{w.rule.name}: #{w.match[:filename]}", w.match[:line].to_i] end.sort do |x, y| x.first == y.first ? x[1] <=> y[1] : x.first <=> y.first end.map { |w| "#{w.first}:#{w[1]}" }.uniq.join("\n") end