Last active
May 6, 2019 01:50
-
-
Save mbj/5947407 to your computer and use it in GitHub Desktop.
Ruby weirdness
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
# jruby 1.7.4 (1.9.3p392) 2013-05-16 2390d3b on OpenJDK 64-Bit Server VM 1.7.0_40-b20 +indy [linux-amd64] | |
class Foo | |
define_method(:initialize) do | |
end | |
end | |
p Foo.public_instance_methods.include?(:initialize) # mri false, jruby true, rbx19 false | |
p Foo.protected_instance_methods.include?(:initialize) # mri false, jruby false, rbx19 false | |
p Foo.private_instance_methods.include?(:initialize) # mri true, jruby false, rbx19 true | |
class Bar | |
def initialize | |
end | |
end | |
p Bar.public_instance_methods.include?(:initialize) # mri false, jruby false, rbx19 false | |
p Bar.protected_instance_methods.include?(:initialize) # mri false, jruby false, rbx19 false | |
p Bar.private_instance_methods.include?(:initialize) # mri true, jruby true, rbx19 true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment