Module: SM::Flow
- Defined in:
- lib/ihelp.rb
Instance Method Summary collapse
Instance Method Details
#to_html ⇒ Object
976 977 978 979 980 981 982 983 984 |
# File 'lib/ihelp.rb', line 976 def to_html tag = self.class.to_s.split("::").last tag = "PRE" if tag == "VERB" xmlstr = %Q(<#{tag}> #{body if respond_to? :body} #{contents.map{|c|c.to_html} if respond_to? :content} </#{tag}>) REXML::Document.new(xmlstr) end |
#to_text ⇒ Object
961 962 963 964 965 966 967 968 969 970 971 972 973 974 |
# File 'lib/ihelp.rb', line 961 def to_text RI::TextFormatter.allocate.conv_html( if respond_to? :body body else "" end + if respond_to? :contents contents.map{|c| c.to_text }.join("\n\n") else "" end ).gsub(/<\/?..>/, '') end |