Class: Source2MD::Type::ElementHeaderComment

Inherits:
Base
  • Object
show all
Defined in:
lib/source2md/type/__element_header_comment.rb

Instance Attribute Summary

Attributes inherited from Base

#element

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Source2MD::Type::Base

Class Method Details

.accept?(element) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/source2md/type/__element_header_comment.rb', line 16

def self.accept?(element)
  element.body.match?(/^#-/)
end

Instance Method Details

#to_mdObject



20
21
22
23
24
25
26
27
# File 'lib/source2md/type/__element_header_comment.rb', line 20

def to_md
  [
    message,
    "```ruby",
    body,
    "```",
  ] * "\n"
end