Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/hash.rb
Instance Method Summary collapse
Instance Method Details
#execute ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/hash.rb', line 2 def execute self.each{|k,v| v.update if v.respond_to?(:update) if(v.is_a?(Array) && v.length==0) self.delete k else #puts "executing #{k}" v.execute if v.respond_to?(:execute) end } end |
#to_html ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/hash.rb', line 14 def to_html [ '<div>', map { |k, v| ["<br/><div><strong>#{k}</strong>", v.respond_to?(:to_html) ? v.to_html : "<span>#{v}</span></div><br/>"] }, '</div>' ].join end |