Class: AnnotateRb::ModelAnnotator::Annotation::MainHeader
- Inherits:
-
Components::Base
- Object
- Components::Base
- AnnotateRb::ModelAnnotator::Annotation::MainHeader
- Defined in:
- lib/annotate_rb/model_annotator/annotation/main_header.rb
Constant Summary collapse
- PREFIX =
Annotate Models plugin use this header
"== Schema Information"
- PREFIX_MD =
"## Schema Information"
Instance Attribute Summary collapse
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(version, include_version) ⇒ MainHeader
constructor
A new instance of MainHeader.
- #to_default ⇒ Object
- #to_markdown ⇒ Object
Methods inherited from Components::Base
Constructor Details
#initialize(version, include_version) ⇒ MainHeader
Returns a new instance of MainHeader.
13 14 15 16 |
# File 'lib/annotate_rb/model_annotator/annotation/main_header.rb', line 13 def initialize(version, include_version) @version = version @include_version = include_version end |
Instance Attribute Details
#version ⇒ Object (readonly)
Returns the value of attribute version.
11 12 13 |
# File 'lib/annotate_rb/model_annotator/annotation/main_header.rb', line 11 def version @version end |
Instance Method Details
#to_default ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/annotate_rb/model_annotator/annotation/main_header.rb', line 27 def to_default header = "# #{PREFIX}" if @include_version && version > 0 header += "\n# Schema version: #{version}" end header end |
#to_markdown ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/annotate_rb/model_annotator/annotation/main_header.rb', line 18 def to_markdown header = "# #{PREFIX_MD}" if @include_version && version > 0 header += "\n# Schema version: #{version}" end header end |