質問編集履歴
1
表示の軽微な修正です。
title
CHANGED
File without changes
|
body
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
- 特異クラスを定義したインスタンスに対して```instance.class.singleton_class?```でtrueを返す。
|
12
12
|
|
13
|
-
```
|
13
|
+
```ruby
|
14
14
|
class Icecream
|
15
15
|
def flavor
|
16
16
|
p "chocolate"
|
@@ -31,7 +31,8 @@
|
|
31
31
|
p ic.class.singleton_class?
|
32
32
|
```
|
33
33
|
しかし、実際に得られたのはのような結果でした。
|
34
|
-
object_idはすべて同じで、singleton_classはfalseを返してしまします。
|
34
|
+
object_idはすべて同じで、 ```singleton_class?``` はfalseを返してしまします。
|
35
|
+
|
35
36
|
```
|
36
37
|
70368599643720
|
37
38
|
70368599643720
|