module Ric::Html

Public Class Methods

anything_to_html(son,opts={}) click to toggle source

REMOVE ME!

   # File lib/ric/html.rb
 9 def self.anything_to_html(son,opts={})
10   ret = '(Ric::Html.anything_to_html)' if opts.fetch(:verbose,true) # TODO change dflt to false
11   if opts != {}
12   ret << "(Options: " + anything_to_html(opts) + ")"
13   end
14   if son.class == Array
15     ret << "<ul class='subtopic' >"
16     son.each{|subtopic|
17       ret << content_tag(:li, anything_to_html(subtopic).html_safe ) # '- ' +
18     }
19     ret << "</ul>"
20   elsif son.class == Hash
21     #ret << hash_to_html(son)
22     ret += '<ul class="maintopic" >'
23     son.each{ |k,val|
24       ret << content_tag(:li, ( anything_to_html(k) + ' => ' + anything_to_html(val) ).html_safe )
25      }
26     ret << "</ul>"
27   elsif son.class == String
28     ret << "<font color='navy' class='ricclass_string' >#{son}</font>"
29   elsif son.class == Symbol
30     ret << "<i><font color='gray' class='ricclass_symbol' >:#{son}</font></i>"
31   else
32     ret << "(Unknown Class: #{son.class}) <b>#{son}</b>"
33   end
34   ret.html_safe
35 end

Public Instance Methods

test() click to toggle source
  # File lib/ric/html.rb
4 def test
5   anything_to_html({:note => 'remove me', :foo => :bar } )
6 end