Class: SourceAnnotationExtractor::Annotation
- Defined in:
- railties/lib/rails/source_annotation_extractor.rb
Instance Attribute Summary collapse
-
#line ⇒ Object
Returns the value of attribute line.
-
#tag ⇒ Object
Returns the value of attribute tag.
-
#text ⇒ Object
Returns the value of attribute text.
Class Method Summary collapse
Instance Method Summary collapse
-
#to_s(options = {}) ⇒ Object
Returns a representation of the annotation that looks like this:.
Methods inherited from Struct
Instance Attribute Details
#line ⇒ Object
Returns the value of attribute line
16 17 18 |
# File 'railties/lib/rails/source_annotation_extractor.rb', line 16 def line @line end |
#tag ⇒ Object
Returns the value of attribute tag
16 17 18 |
# File 'railties/lib/rails/source_annotation_extractor.rb', line 16 def tag @tag end |
#text ⇒ Object
Returns the value of attribute text
16 17 18 |
# File 'railties/lib/rails/source_annotation_extractor.rb', line 16 def text @text end |
Class Method Details
.directories ⇒ Object
17 18 19 |
# File 'railties/lib/rails/source_annotation_extractor.rb', line 17 def self.directories @@directories ||= %w(app config db lib test) + (ENV['SOURCE_ANNOTATION_DIRECTORIES'] || '').split(',') end |
Instance Method Details
#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.
27 28 29 30 31 |
# File 'railties/lib/rails/source_annotation_extractor.rb', line 27 def to_s(={}) s = "[#{line.to_s.rjust([:indent])}] " s << "[#{tag}] " if [:tag] s << text end |