Sha256: 3f7c1983d59f2da4e747c0ba2a1b8b9ee0e5b606461bd07928a99ba24fc63c43
Contents?: true
Size: 422 Bytes
Versions: 5
Compression:
Stored size: 422 Bytes
Contents
class Hash def execute self.each{|k,v| if(v.is_a?(Array) && v.length==0) self.delete k else #puts "executing #{k}" v.execute 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
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
dev_commands-0.0.10 | lib/hash.rb |
dev_commands-0.0.9 | lib/hash.rb |
dev_commands-0.0.8 | lib/hash.rb |
dev_commands-0.0.7 | lib/hash.rb |
dev_commands-0.0.6 | lib/hash.rb |