Class: ReadmeYard::ExampleTag
- Inherits:
-
Object
- Object
- ReadmeYard::ExampleTag
- Defined in:
- lib/readme_yard/example_tag.rb
Class Method Summary collapse
- .format_markdown(yard_object, yard_tags) ⇒ Object
- .format_ruby(text) ⇒ Object
- .format_tag_markdown(yard_object, tag) ⇒ Object
Class Method Details
.format_markdown(yard_object, yard_tags) ⇒ Object
4 5 6 |
# File 'lib/readme_yard/example_tag.rb', line 4 def format_markdown(yard_object, ) .map { |tag| format_tag_markdown(yard_object, tag) }.join("\n") end |
.format_ruby(text) ⇒ Object
13 14 15 |
# File 'lib/readme_yard/example_tag.rb', line 13 def format_ruby(text) "```ruby\n#{text}\n```\n" end |
.format_tag_markdown(yard_object, tag) ⇒ Object
8 9 10 11 |
# File 'lib/readme_yard/example_tag.rb', line 8 def format_tag_markdown(yard_object, tag) text = tag.text.empty? ? yard_object.source : tag.text format_ruby(text) end |