From 831aa6cd961ce56ef248d3a078db4f75c5d2bf6b Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> Date: Wed, 24 Feb 1999 04:31:29 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'v1_3_1_990224'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_3_1_990224@406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- sample/list.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'sample/list.rb') diff --git a/sample/list.rb b/sample/list.rb index 76035e67d6..17eefae85a 100644 --- a/sample/list.rb +++ b/sample/list.rb @@ -1,8 +1,8 @@ # Linked list example class MyElem - # オブジェクト生成時に自動的に呼ばれるメソッド + # object initializer called from Class#new def initialize(item) - # @変数はインスタンス変数(宣言は要らない) + # @variables are instance variable, no declaration needed @data = item @succ = nil end @@ -15,7 +15,7 @@ class MyElem @succ end - # 「obj.data = val」としたときに暗黙に呼ばれるメソッド + # the method invoked by ``obj.data = val'' def succ=(new) @succ = new end @@ -40,12 +40,12 @@ class MyList end end - # オブジェクトを文字列に変換するメソッド - # これを再定義するとprintでの表現が変わる + # the method to convert object into string. + # redefining this will affect print. def to_s str = "