Class: Bones::AnnotationExtractor::Annotation

Inherits:
Struct
  • Object
show all
Defined in:
lib/bones/annotation_extractor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#lineObject

Returns the value of attribute line

Returns:

  • (Object)

    the current value of line



16
17
18
# File 'lib/bones/annotation_extractor.rb', line 16

def line
  @line
end

#tagObject

Returns the value of attribute tag

Returns:

  • (Object)

    the current value of tag



16
17
18
# File 'lib/bones/annotation_extractor.rb', line 16

def tag
  @tag
end

#textObject

Returns the value of attribute text

Returns:

  • (Object)

    the current value of 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