Last active
July 12, 2021 03:43
-
-
Save JuzerShakir/5ab2c734e8446ae42ac8086689aca921 to your computer and use it in GitHub Desktop.
Used in medium
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
require_relative '01.define_module' | |
extend Test | |
class C_test | |
p self.ancestors # => [C_test, Object, Kernel, BasicObject] | |
p self.singleton_class.ancestors | |
# => # => <Class:Klass>, Test, #<Class:Object>, #<Class:BasicObject>, Class, Module, Object, Kernel, BasicObject] | |
end | |
C_test.new.hello # => undefined method `hello' for #<C_test:0x0000555e680067e0> (NoMethodError) | |
C_test.hello # => undefined method `hello' for C_test:Class (NoMethodError) | |
hello # => I'm an instance method. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment