Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/base/hash.rb

Direct Known Subclasses

Command, Commands, Environment, MSBuild, Project, Projects

Instance Method Summary collapse

Instance Method Details

#execute(value = nil) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/base/hash.rb', line 4

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
  v.execute(value) if v.respond_to?(:execute)
  end
	  }
end

#to_htmlObject



14
15
16
17
18
19
20
# File 'lib/base/hash.rb', line 14

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