-
-
Save emmx/2cf88b033902b59f5c2514e0f0a68070 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def example(a, b) | |
puts a*b | |
end | |
class MyClass | |
def initialize | |
myfunc = :example | |
if respond_to? myfunc | |
puts send myfunc, 2, 3 | |
end | |
end | |
end | |
# Should print 6 | |
MyClass.new |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment