Class: AnnotateRb::ModelAnnotator::IndexAnnotation::Annotation
- Inherits:
-
Object
- Object
- AnnotateRb::ModelAnnotator::IndexAnnotation::Annotation
- Defined in:
- lib/annotate_rb/model_annotator/index_annotation/annotation.rb
Constant Summary collapse
- HEADER_TEXT =
"Indexes"
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(indexes) ⇒ Annotation
constructor
A new instance of Annotation.
- #to_default ⇒ Object
- #to_markdown ⇒ Object
Constructor Details
#initialize(indexes) ⇒ Annotation
Returns a new instance of Annotation.
9 10 11 |
# File 'lib/annotate_rb/model_annotator/index_annotation/annotation.rb', line 9 def initialize(indexes) @indexes = indexes end |
Instance Method Details
#body ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/annotate_rb/model_annotator/index_annotation/annotation.rb', line 13 def body [ Components::BlankCommentLine.new, Components::Header.new(HEADER_TEXT), Components::BlankCommentLine.new, *@indexes ] end |
#to_default ⇒ Object
26 27 28 |
# File 'lib/annotate_rb/model_annotator/index_annotation/annotation.rb', line 26 def to_default body.map(&:to_default).join("\n") end |
#to_markdown ⇒ Object
22 23 24 |
# File 'lib/annotate_rb/model_annotator/index_annotation/annotation.rb', line 22 def to_markdown body.map(&:to_markdown).join("\n") end |