instance method to_s

Ruby on Rails 6.1.7.10

Since v6.0.6

Available in: v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

to_s(options = {})

Returns a representation of the annotation that looks like this:

[126] [TODO] This algorithm is simple and clearly correct, make it faster.

If options has a flag :tag the tag is shown as in the example above. Otherwise the string contains just line and text.

Parameters

options opt = {}
Source
# File railties/lib/rails/source_annotation_extractor.rb, line 55
      def to_s(options = {})
        s = +"[#{line.to_s.rjust(options[:indent])}] "
        s << "[#{tag}] " if options[:tag]
        s << text
      end

Defined in railties/lib/rails/source_annotation_extractor.rb line 55 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Rails::SourceAnnotationExtractor::Annotation

Type at least 2 characters to search.

↑↓ navigate · open · esc close