Skip to content

Instantly share code, notes, and snippets.

@JuzerShakir
Last active July 12, 2021 03:43
Show Gist options
  • Save JuzerShakir/5ab2c734e8446ae42ac8086689aca921 to your computer and use it in GitHub Desktop.
Save JuzerShakir/5ab2c734e8446ae42ac8086689aca921 to your computer and use it in GitHub Desktop.
Used in medium
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