Class: MarkdownRubyDocumentation::PrintMethodSource
- Inherits:
-
Object
- Object
- MarkdownRubyDocumentation::PrintMethodSource
- Defined in:
- lib/markdown_ruby_documentation/template_parser/print_method_source.rb
Instance Method Summary collapse
-
#initialize(method:) ⇒ PrintMethodSource
constructor
A new instance of PrintMethodSource.
- #print ⇒ Object
Constructor Details
#initialize(method:) ⇒ PrintMethodSource
Returns a new instance of PrintMethodSource.
3 4 5 |
# File 'lib/markdown_ruby_documentation/template_parser/print_method_source.rb', line 3 def initialize(method:) @method_object = method end |
Instance Method Details
#print ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/markdown_ruby_documentation/template_parser/print_method_source.rb', line 7 def print method_object.to_proc .source .split("\n")[1..-2] .map(&:lstrip) .join("\n") end |