J
Joe Van Dyk
Hi,
I couldn't work out the syntax for the following:
class Reports
def self.This; end
def self.That; end
end
def do_something_with_a_report report
# calls Reports::This or Reports::That, dtermined by what report is
# something like report.call ?
end
I want to do something like:
do_something_with_a_report Reports::This
But that calls Reports::This and sends that value to the
do_something_with_a_report function.
In other words, I want to do something like passing a function pointer
to a function in C.
I couldn't work out the syntax for the following:
class Reports
def self.This; end
def self.That; end
end
def do_something_with_a_report report
# calls Reports::This or Reports::That, dtermined by what report is
# something like report.call ?
end
I want to do something like:
do_something_with_a_report Reports::This
But that calls Reports::This and sends that value to the
do_something_with_a_report function.
In other words, I want to do something like passing a function pointer
to a function in C.