Class: Hash

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

Direct Known Subclasses

Command

Instance Method Summary collapse

Instance Method Details

#executeObject



2
3
4
5
6
# File 'lib/hash.rb', line 2

def execute
    self.each{|k,v|
v.execute if v.respond_to?(:execute)
    }
end

#to_htmlObject



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

def to_html
  [
    '<ul>',
    map { |k, v| ["<li><strong>#{k}</strong>", v.respond_to?(:to_html) ? v.to_html : "<span>#{v}</span></li>"] },
    '</ul>'
  ].join
end