Class: ReadmeYard::SourceTag

Inherits:
Object
  • Object
show all
Defined in:
lib/readme_yard/source_tag.rb

Overview

Embed Ruby comments and code

Examples:

# @readme source

Class Method Summary collapse

Class Method Details

.format_tag(yard_object, _tag) ⇒ Object

The comment and code for ReadmeYard::SourceTag#format_tag is in the README because @readme source is below (in the source code).



19
20
21
22
23
# File 'lib/readme_yard/source_tag.rb', line 19

def format_tag(yard_object, _tag)
  text = CommentTag.format_docstring_as_comment(yard_object)
  text << "\n#{yard_object.source}"
  ExampleTag.format_ruby(text)
end

.format_yard_object(yard_object) ⇒ Object



25
26
27
# File 'lib/readme_yard/source_tag.rb', line 25

def format_yard_object(yard_object)
  format_tag(yard_object, nil)
end