Created
August 9, 2017 00:24
-
-
Save igaiga/0aa3859e50a3d7ceaa74f9f2c67ea6a0 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 | |
p self #=> Foo (Fooクラス) | |
@bar = "hello!" | |
def foo | |
p self #=> #<Foo:0x007ff63a2471f0> (Fooクラスインスタンス) | |
p @bar = "hi!" | |
end | |
def self.foo | |
p self #=> Foo (Fooクラス) | |
p @bar #=> "hello!" | |
end | |
end | |
Foo.new.foo | |
Foo.foo | |
# Foo | |
# #<Foo:0x007fdd148eaf50> | |
# "hi!" | |
# Foo | |
# "hello!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment