Class: AnnotateRb::ModelAnnotator::Annotation::SchemaHeader
- Inherits:
-
Components::Base
- Object
- Components::Base
- AnnotateRb::ModelAnnotator::Annotation::SchemaHeader
- Defined in:
- lib/annotate_rb/model_annotator/annotation/schema_header.rb
Defined Under Namespace
Classes: TableName
Instance Attribute Summary collapse
-
#table_comment ⇒ Object
readonly
Returns the value of attribute table_comment.
-
#table_name ⇒ Object
readonly
Returns the value of attribute table_name.
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(table_name, table_comment, options) ⇒ SchemaHeader
constructor
A new instance of SchemaHeader.
- #to_default ⇒ Object
- #to_markdown ⇒ Object
Methods inherited from Components::Base
Constructor Details
#initialize(table_name, table_comment, options) ⇒ SchemaHeader
Returns a new instance of SchemaHeader.
25 26 27 28 29 |
# File 'lib/annotate_rb/model_annotator/annotation/schema_header.rb', line 25 def initialize(table_name, table_comment, ) @table_name = table_name @table_comment = table_comment @options = end |
Instance Attribute Details
#table_comment ⇒ Object (readonly)
Returns the value of attribute table_comment.
23 24 25 |
# File 'lib/annotate_rb/model_annotator/annotation/schema_header.rb', line 23 def table_comment @table_comment end |
#table_name ⇒ Object (readonly)
Returns the value of attribute table_name.
23 24 25 |
# File 'lib/annotate_rb/model_annotator/annotation/schema_header.rb', line 23 def table_name @table_name end |
Instance Method Details
#body ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/annotate_rb/model_annotator/annotation/schema_header.rb', line 31 def body [ Components::BlankCommentLine.new, TableName.new(name), Components::BlankCommentLine.new ] end |
#to_default ⇒ Object
39 40 41 |
# File 'lib/annotate_rb/model_annotator/annotation/schema_header.rb', line 39 def to_default body.map(&:to_default).join("\n") end |
#to_markdown ⇒ Object
43 44 45 |
# File 'lib/annotate_rb/model_annotator/annotation/schema_header.rb', line 43 def to_markdown body.map(&:to_markdown).join("\n") end |