Extended maintenance of Ruby 1.9.3 ended on February 23, 2015. Read more
Extracts sections of text enclosed in plus, tt or code. Used to discover undocumented parameters.
Pops the list type for list
from list_type
# File rdoc/markup/to_tt_only.rb, line 32 def accept_list_end list @list_type.pop end
Prepares the visitor for consuming list_item
# File rdoc/markup/to_tt_only.rb, line 46 def accept_list_item_start list_item case @list_type.last when :NOTE, :LABEL then tt_sections(list_item.label) end end
Pushes the list type for list
onto list_type
# File rdoc/markup/to_tt_only.rb, line 39 def accept_list_start list @list_type << list.type end
Adds paragraph
to the output
# File rdoc/markup/to_tt_only.rb, line 56 def accept_paragraph paragraph tt_sections(paragraph.text) end
Does nothing to markup_item
because it doesn’t have any
user-built content
# File rdoc/markup/to_tt_only.rb, line 64 def do_nothing markup_item end
Returns an Array of items that were wrapped in plus, tt or code.
# File rdoc/markup/to_tt_only.rb, line 100 def end_accepting @res.compact end
Prepares the visitor for gathering tt sections
# File rdoc/markup/to_tt_only.rb, line 107 def start_accepting @res = [] @list_type = [] end
Extracts tt sections from text
# File rdoc/markup/to_tt_only.rb, line 77 def tt_sections text flow = @am.flow text.dup flow.each do |item| case item when String then @res << item if in_tt? when RDoc::Markup::AttrChanger then off_tags res, item on_tags res, item when RDoc::Markup::Special then @res << convert_special(item) if in_tt? # TODO can this happen? else raise "Unknown flow element: #{item.inspect}" end end res end
Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.
If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.
If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.
If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.