-
-
Save havenwood/36ec67eed5902ae70fa24d10c7a6368e 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
# frozen_string_literal: true | |
class Hello | |
attr_reader :foo, :bar | |
def initialize | |
@foo = Foo.new(self) | |
@bar = Bar.new(self) | |
@foo.hello | |
@bar.hello | |
end | |
end | |
class Foo | |
def initialize(hello) | |
@hello = hello | |
end | |
def hello | |
p @hello | |
end | |
end | |
class Bar | |
def initialize(hello) | |
@hello = hello | |
end | |
def hello | |
p @hello | |
end | |
end | |
Hello.new |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment