Class: SourceAnnotationExtractor::Annotation
Instance Attribute Summary (collapse)
-
- (Object) line
Returns the value of attribute line.
-
- (Object) tag
Returns the value of attribute tag.
-
- (Object) text
Returns the value of attribute text.
Instance Method Summary (collapse)
-
- (Object) to_s(options = {})
Returns a representation of the annotation that looks like this:.
Methods inherited from Struct
Instance Attribute Details
- (Object) line
Returns the value of attribute line
16 17 18 |
# File 'railties/lib/rails/source_annotation_extractor.rb', line 16 def line @line end |
- (Object) tag
Returns the value of attribute tag
16 17 18 |
# File 'railties/lib/rails/source_annotation_extractor.rb', line 16 def tag @tag end |
- (Object) text
Returns the value of attribute text
16 17 18 |
# File 'railties/lib/rails/source_annotation_extractor.rb', line 16 def text @text end |
Instance Method Details
- (Object) 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.
24 25 26 27 28 |
# File 'railties/lib/rails/source_annotation_extractor.rb', line 24 def to_s(={}) s = "[%3d] " % line s << "[#{tag}] " if [:tag] s << text end |