Method: Rails::SourceAnnotationExtractor::Annotation#to_s
- Defined in:
- railties/lib/rails/source_annotation_extractor.rb
#to_s(options = {}) ⇒ Object
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.
124 125 126 127 128 |
# File 'railties/lib/rails/source_annotation_extractor.rb', line 124 def to_s( = {}) s = +"[#{line.to_s.rjust(options[:indent])}] " s << "[#{tag}] " if [:tag] s << text end |