Module SM::Flow
In: lib/ihelp.rb

Methods

to_html   to_text  

Public Instance methods

[Source]

     # File lib/ihelp.rb, line 974
974:   def to_html
975:     tag = self.class.to_s.split("::").last
976:     tag = "PRE" if tag == "VERB"
977:     xmlstr = %Q(<#{tag}>
978:       #{body if respond_to? :body}
979:       #{contents.map{|c|c.to_html} if respond_to? :content}
980:     </#{tag}>)
981:     REXML::Document.new(xmlstr)
982:   end

[Source]

     # File lib/ihelp.rb, line 959
959:   def to_text
960:     RI::TextFormatter.allocate.conv_html(
961:       if respond_to? :body
962:         body
963:       else
964:         ""
965:       end +
966:       if respond_to? :contents
967:         contents.map{|c| c.to_text }.join("\n\n")
968:       else
969:         ""
970:       end
971:     ).gsub(/<\/?..>/, '')
972:   end

[Validate]