Skip to content

Instantly share code, notes, and snippets.

@aergonaut
Created September 25, 2019 06:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aergonaut/6f78370ba2233b6c763053f933f2e132 to your computer and use it in GitHub Desktop.
Save aergonaut/6f78370ba2233b6c763053f933f2e132 to your computer and use it in GitHub Desktop.
class Foo
private
def initialize
puts "calling initialize"
end
end
foo = Foo.new
class Foo
class << self
undef_method :initialize
end
end
class Bar < Foo
end
bar = Bar.new
puts bar.inspect
class Foo
class << self
undef_method :instance_variable_set
undef_method :instance_variable_get
end
end
class Bar < Foo
attr_accessor :baz
end
bar = Bar.new
bar.baz = "hello"
puts bar.baz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment