Class | RI::MethodDescription |
In: |
lib/ihelp.rb
|
Parent: | Object |
Creates HTML element from the MethodDescription. Uses container_tag as the root node name and header_tag as the tag for the header element that contains the method’s name.
Returns a REXML document with container_tag as the root element name.
# File lib/ihelp.rb, line 442 442: def to_html(container_tag="div", header_tag="h1") 443: doc = REXML::Document.new 444: root = doc.add_element(container_tag) 445: header = root.add_element(header_tag) 446: header.add_text(full_name) 447: comment.each{|c| 448: tag = c.class.to_s.split("::").last 449: tag = "PRE" if tag == "VERB" 450: xmlstr = "<#{tag}>#{c.body}</#{tag}>" 451: c_doc = REXML::Document.new(xmlstr) 452: root.add_element( c_doc.root ) 453: } 454: doc 455: end