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.106 lib/commands/hash.rb
dev-2.0.105 lib/commands/hash.rb
dev-2.0.104 lib/commands/hash.rb
dev-2.0.103 lib/commands/hash.rb
dev-2.0.102 lib/commands/hash.rb
dev-2.0.101 lib/commands/hash.rb
dev-2.0.100 lib/commands/hash.rb
dev-2.0.46 lib/hash.rb
dev-2.0.45 lib/hash.rb
dev-2.0.44 lib/hash.rb
dev-2.0.43 lib/hash.rb
dev-2.0.42 lib/hash.rb
dev_commands-0.0.58 lib/hash.rb
dev_commands-0.0.57 lib/hash.rb
dev_commands-0.0.54 lib/hash.rb
dev_commands-0.0.53 lib/hash.rb
dev_commands-0.0.52 lib/hash.rb
dev_commands-0.0.51 lib/hash.rb
dev_commands-0.0.50 lib/hash.rb