Sha256: 4e33e5f1dec0e1fc3ae7a2aead1e3f074ce69c5e4784e93a8f40c7d91a0c8466

Contents?: true

Size: 484 Bytes

Versions: 13

Compression:

Stored size: 484 Bytes

Contents

class Hash
	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
	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

13 entries across 13 versions & 1 rubygems

Version Path
dev_commands-0.0.33 lib/hash.rb
dev_commands-0.0.32 lib/hash.rb
dev_commands-0.0.31 lib/hash.rb
dev_commands-0.0.30 lib/hash.rb
dev_commands-0.0.29 lib/hash.rb
dev_commands-0.0.28 lib/hash.rb
dev_commands-0.0.27 lib/hash.rb
dev_commands-0.0.26 lib/hash.rb
dev_commands-0.0.22 lib/hash.rb
dev_commands-0.0.21 lib/hash.rb
dev_commands-0.0.20 lib/hash.rb
dev_commands-0.0.19 lib/hash.rb
dev_commands-0.0.18 lib/hash.rb