Sha256: 6b2e7a87ee04b8a6c87ee27c5b1bdfd50e9058173fdbf372a4bfc9eb35de74c8

Contents?: true

Size: 481 Bytes

Versions: 7

Compression:

Stored size: 481 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

7 entries across 7 versions & 1 rubygems

Version Path
dev_commands-0.0.56 lib/hash.rb
dev_commands-0.0.55 lib/hash.rb
dev_commands-0.0.49 lib/hash.rb
dev_commands-0.0.48 lib/hash.rb
dev_commands-0.0.47 lib/hash.rb
dev_commands-0.0.41 lib/hash.rb
dev_commands-0.0.40 lib/hash.rb