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
16 17 18 |
# File 'lib/bones/annotation_extractor.rb', line 16 def line @line end |
#tag ⇒ Object
Returns the value of attribute tag
16 17 18 |
# File 'lib/bones/annotation_extractor.rb', line 16 def tag @tag end |
#text ⇒ Object
Returns the value of attribute text
16 17 18 |
# File 'lib/bones/annotation_extractor.rb', line 16 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.
21 22 23 24 25 |
# File 'lib/bones/annotation_extractor.rb', line 21 def to_s( opts = {} ) s = "[%3d] " % line s << "[#{tag}] " if opts[:tag] s << text end |