Class: Bones::AnnotationExtractor::Annotation
- Defined in:
- lib/bones/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.
Instance Method Summary collapse
-
#to_s(opts = {}) ⇒ Object
Returns a string representation of the annotation.
Instance Attribute Details
#line ⇒ Object
Returns the value of attribute line
7 8 9 |
# File 'lib/bones/annotation_extractor.rb', line 7 def line @line end |
#tag ⇒ Object
Returns the value of attribute tag
7 8 9 |
# File 'lib/bones/annotation_extractor.rb', line 7 def tag @tag end |
#text ⇒ Object
Returns the value of attribute text
7 8 9 |
# File 'lib/bones/annotation_extractor.rb', line 7 def text @text end |
Instance Method Details
#to_s(opts = {}) ⇒ Object
Returns a string representation of the annotation. If the :tag
parameter is given as true
, then the annotation tag will be included in the string.
12 13 14 15 16 |
# File 'lib/bones/annotation_extractor.rb', line 12 def to_s( opts = {} ) s = "[#{Bones::Colors.colorize('%3d', :magenta)}] " % line s << "[#{Bones::Colors.colorize(tag, :cyan)}] " if opts[:tag] s << text end |