Class: Ahnnotate::Function::Format

Inherits:
Object
  • Object
show all
Defined in:
lib/ahnnotate/function/format.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#commentObject (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