summaryrefslogtreecommitdiff
path: root/sample/list.rb
diff options
context:
space:
mode:
Diffstat (limited to 'sample/list.rb')
-rw-r--r--sample/list.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/sample/list.rb b/sample/list.rb
index fa145f46277..93e3182f841 100644
--- a/sample/list.rb
+++ b/sample/list.rb
@@ -1,7 +1,7 @@
# Linked list example
class MyElem
# オブジェクト生成時に自動的に呼ばれるメソッド
- def init_object(item)
+ def initialize(item)
# @変数はインスタンス変数(宣言は要らない)
@data = item
@next = nil
@@ -54,7 +54,7 @@ class MyList
end
class Point
- def init_object(x, y)
+ def initialize(x, y)
@x = x; @y = y
self
end