Sha256: 67da2a29152be80daeef08c4177e0689429de1426488ec1ef0758c9f746caa0e
Contents?: true
Size: 501 Bytes
Versions: 59
Compression:
Stored size: 501 Bytes
Contents
class Hash def execute value=nil 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(value) if v.respond_to?(:execute) end } end 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 end
Version data entries
59 entries across 59 versions & 2 rubygems