Class: MarkdownRubyDocumentation::TemplateParser

Inherits:
Object
  • Object
show all
Includes:
CommentMacros
Defined in:
lib/markdown_ruby_documentation/template_parser.rb,
lib/markdown_ruby_documentation/template_parser/parsing.rb

Defined Under Namespace

Modules: CommentMacros, Parsing

Constant Summary

Constants included from CommentMacros

CommentMacros::IGNORE_METHOD_OWNERS, CommentMacros::RUBY_TO_MARKDOWN_PROCESSORS, CommentMacros::UnimplementedMethod

Constants included from Parsing

Parsing::CLASS_MACROS

Instance Method Summary collapse

Methods included from CommentMacros

#array_to_markdown_table, #boolean_blocks, #comment_format, #constants_with_name_and_value, #convert_early_return_to_if_else, #default_title, #elsif_to_else_if, #eval_method, #format_link, #git_hub_file_url, #git_hub_method_url, #hash_to_markdown_table, #link_to_markdown, #link_to_markdown_full_path, #link_to_markdown_method_reference, #markdown_table_header, #methods_as_local_links, #nil_check_readable, #pretty_early_return, #print_mark_doc_from, #print_method_source, #print_raw_comment, #question_mark_method_format, #readable_ruby_numbers, #remove_colons, #remove_end_keyword, #remove_memoized_vars, #rescue_format, #ruby_case_statement_to_md, #ruby_if_statement_to_md, #ruby_operators_to_english, #ruby_to_markdown, #symbol_to_proc, #ternary_to_if_else, #title_from_link

Methods included from Parsing

#extract_dsl_comment, #extract_dsl_comment_from_method, #get_line_number, #insert_method_name, #look_for_class_macro_comment, #parse_erb, #ruby_class_meth_comment, #ruby_class_meth_source_location, #source_location, #strip_comment_hash, #when_only_start, #when_start_and_end

Constructor Details

#initialize(ruby_class, methods) ⇒ TemplateParser

Returns a new instance of TemplateParser.



4
5
6
7
8
# File 'lib/markdown_ruby_documentation/template_parser.rb', line 4

def initialize(ruby_class, methods)
  @ruby_class        = ruby_class
  @methods           = methods.map { |method| method.is_a?(Symbol) ? InstanceMethod.new("##{method}", context: ruby_class) : method }
  @erb_methods_class = erb_methods_class
end

Instance Method Details

#to_hash(*args) ⇒ Object Also known as: call



10
11
12
# File 'lib/markdown_ruby_documentation/template_parser.rb', line 10

def to_hash(*args)
  parser
end