M
Mark Probert
Hi ..
I am doing indirect dispatch, something like:
class Foo
def bar(fn)
eval "self.#{fn}"
end
end
class Bar < Foo
def blah
puts "blah here"
end
end
f = Bar.new
f.bar("blah")
It works however I am sure there must be a nicer way of doing the bar(fn)
stuff. Any ideas?
TIA,
-mark.
I am doing indirect dispatch, something like:
class Foo
def bar(fn)
eval "self.#{fn}"
end
end
class Bar < Foo
def blah
puts "blah here"
end
end
f = Bar.new
f.bar("blah")
It works however I am sure there must be a nicer way of doing the bar(fn)
stuff. Any ideas?
TIA,
-mark.