-
-
Save adaedra/5854e1ec31b4794dbfd1 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
module Foo | |
def meth11 | |
# This will be an instance method | |
11 | |
end | |
define_method :meth12 do | |
# This will be an instance method | |
12 | |
end | |
end | |
Foo.instance_exec do | |
def meth21 | |
# This will be a module method | |
21 | |
end | |
define_method :meth22 do | |
# This will be an instance method | |
22 | |
end | |
end | |
p Foo.instance_methods.include?(:meth11) # true | |
p Foo.instance_methods.include?(:meth12) # true | |
p Foo.instance_methods.include?(:meth21) # false | |
p Foo.instance_methods.include?(:meth22) # true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment