you can use eval and binding :

csv=<<EEND
;;foo(2);;
;;fee(3,4,5);;
EEND

class Excel
  def foo(n) p ['foo',n] ; @foo||=[] ; @foo << n end
  def fee(*n) p ['fee',n]; @fee||=[] ; @fee << n end
  def get_binding() binding() end
  def rapport() puts "**** rapport ***";p @foo||[]; p @fee||[] end
end

excel=Excel.new
bind=excel.get_binding

csv.split(/\r?\n/).each { |line|
 line.split(';').each { |cell| eval(cell,bind) }
}
excel.rapport


Execution :

>ruby excel.rb
["foo", 2]
["fee", [3, 4, 5]]
**** rapport ***
[2]
[[3, 4, 5]]

-- 
Posted via http://www.ruby-forum.com/.