Class: Source2MD::Formatter::TypeMethod
- Inherits:
-
Base
- Object
- Base
- Source2MD::Formatter::TypeMethod
show all
- Defined in:
- lib/source2md/formatter/type_method.rb
Instance Attribute Summary
Attributes inherited from Base
#element
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Class Method Details
.accept?(element) ⇒ Boolean
4
5
6
|
# File 'lib/source2md/formatter/type_method.rb', line 4
def self.accept?(element)
element.head["name"]
end
|
Instance Method Details
#to_md ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/source2md/formatter/type_method.rb', line 8
def to_md
o = []
o << "### #{element.head["name"]} ###\n"
if v = element.head["desc"]
o << "\n"
o << v + "\n"
o << "\n"
end
o << CodeBlock.new(body).to_md
if v = element.head["comment"]
o << "\n"
o << v + "\n"
o << "\n"
end
o.join
end
|