Created
September 25, 2019 06:17
-
-
Save aergonaut/6f78370ba2233b6c763053f933f2e132 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
class Foo | |
private | |
def initialize | |
puts "calling initialize" | |
end | |
end | |
foo = Foo.new |
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
class Foo | |
class << self | |
undef_method :initialize | |
end | |
end | |
class Bar < Foo | |
end | |
bar = Bar.new | |
puts bar.inspect |
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
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