A
ajtwatching
Hey folks,
Like many posts have no doubt started.. I'm giving this ruby business
a crack!!
Now this might be a really bad approach.. but I'll throw it out there.
Here's my simple class.
class Myclass
def initialize
end
def hello
puts "hello"
end
def bye
puts "bye"
end
end
As expected, works a treat.
friendly = Myclass.new
friendly.hello
friendly.bye
Now, given I now what methods are available, is there a way to do
something similar to this...
methods = ['hello', 'bye']
methods.each { |m| friendly.m }
Regards,
ajt.
Like many posts have no doubt started.. I'm giving this ruby business
a crack!!
Now this might be a really bad approach.. but I'll throw it out there.
Here's my simple class.
class Myclass
def initialize
end
def hello
puts "hello"
end
def bye
puts "bye"
end
end
As expected, works a treat.
friendly = Myclass.new
friendly.hello
friendly.bye
Now, given I now what methods are available, is there a way to do
something similar to this...
methods = ['hello', 'bye']
methods.each { |m| friendly.m }
Regards,
ajt.