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

Version Path
dev-2.0.128 lib/commands/hash.rb
dev-2.0.127 lib/commands/hash.rb
dev-2.0.126 lib/commands/hash.rb
dev-2.0.124 lib/commands/hash.rb
dev-2.0.123 lib/commands/hash.rb
dev-2.0.122 lib/commands/hash.rb
dev-2.0.121 lib/commands/hash.rb
dev-2.0.119 lib/commands/hash.rb
dev-2.0.118 lib/commands/hash.rb
dev-2.0.117 lib/commands/hash.rb
dev-2.0.116 lib/commands/hash.rb
dev-2.0.115 lib/commands/hash.rb
dev-2.0.114 lib/commands/hash.rb
dev-2.0.113 lib/commands/hash.rb
dev-2.0.112 lib/commands/hash.rb
dev-2.0.111 lib/commands/hash.rb
dev-2.0.110 lib/commands/hash.rb
dev-2.0.109 lib/commands/hash.rb
dev-2.0.108 lib/commands/hash.rb
dev-2.0.107 lib/commands/hash.rb