Sha256: 5b8f0bd20899703cd5de49ea0e3e07e54a4d219cf14c16557562c1a20ef12153

Contents?: true

Size: 1.11 KB

Versions: 29

Compression:

Stored size: 1.11 KB

Contents

module Ric
 module Html
  
  def test
    anything_to_html({:note => 'remove me', :foo => :bar } )
  end
  
  # REMOVE ME!
  def self.anything_to_html(son,opts={})
    ret = '(Ric::Html.anything_to_html)' if opts.fetch(:verbose,true) # TODO change dflt to false
    if opts != {}
    ret << "(Options: " + anything_to_html(opts) + ")"
    end
    if son.class == Array
      ret << "<ul class='subtopic' >"
      son.each{|subtopic|
        ret << content_tag(:li, anything_to_html(subtopic).html_safe ) # '- ' + 
      }
      ret << "</ul>"
    elsif son.class == Hash
      #ret << hash_to_html(son)
      ret += '<ul class="maintopic" >'
      son.each{ |k,val|
        ret << content_tag(:li, ( anything_to_html(k) + ' => ' + anything_to_html(val) ).html_safe )
       }
      ret << "</ul>"
    elsif son.class == String
      ret << "<font color='navy' class='ricclass_string' >#{son}</font>"
    elsif son.class == Symbol
      ret << "<i><font color='gray' class='ricclass_symbol' >:#{son}</font></i>"
    else
      ret << "(Unknown Class: #{son.class}) <b>#{son}</b>"
    end
    ret.html_safe
  end
  
 end #/Html
end #/Ric

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
ric-0.14.2 lib/ric/html.rb
ric-0.14.1 lib/ric/html.rb
ric-0.14.0 lib/ric/html.rb
ric-0.13.0 lib/ric/html.rb
ric-0.12.2 lib/ric/html.rb
ric-0.12.0 lib/ric/html.rb
ric-0.11.19 lib/ric/html.rb
ric-0.11.18 lib/ric/html.rb
ric-0.11.16 lib/ric/html.rb
ric-0.11.15 lib/ric/html.rb
ric-0.11.14 lib/ric/html.rb
ric-0.11.13 lib/ric/html.rb
ric-0.11.12 lib/ric/html.rb
ric-0.11.11 lib/ric/html.rb
ric-0.11.10 lib/ric/html.rb
ric-0.11.9 lib/ric/html.rb
ric-0.11.7 lib/ric/html.rb
ric-0.11.6 lib/ric/html.rb
ric-0.11.4 lib/ric/html.rb
ric-0.11.3 lib/ric/html.rb