Class: Ahnnotate::Function::Format
- Inherits:
-
Object
- Object
- Ahnnotate::Function::Format
- Defined in:
- lib/ahnnotate/function/format.rb
Instance Attribute Summary collapse
-
#comment ⇒ Object
readonly
Returns the value of attribute comment.
Instance Method Summary collapse
- #call(table, content) ⇒ Object
-
#initialize(comment:) ⇒ Format
constructor
A new instance of Format.
Constructor Details
#initialize(comment:) ⇒ Format
Returns a new instance of Format.
6 7 8 |
# File 'lib/ahnnotate/function/format.rb', line 6 def initialize(comment:) @comment = comment end |
Instance Attribute Details
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
4 5 6 |
# File 'lib/ahnnotate/function/format.rb', line 4 def comment @comment end |
Instance Method Details
#call(table, content) ⇒ Object
10 11 12 |
# File 'lib/ahnnotate/function/format.rb', line 10 def call(table, content) table.string(comment: comment) + "\n" + strip_schema(content) end |