From: Andrea Dallera Date: 2010-04-12T06:34:04+09:00 Subject: Re: Method call within a class Hei Li, yes, the default deceiver is 'self' so, if omitted, the receiver for any message will be the istance itself. -- Andrea Dallera http://github.com/bolthar/freightrain http://usingimho.wordpress.com On Mon, 2010-04-12 at 04:15 +0900, Li Chen wrote: > Andrea Dallera wrote: > > Hei, > > > > "each"'s receiver will be an instance of a class that includes the > > module Enumerable and "size"'s receiver will be an instance of the class > > Array. Example: > > > > array = Array.new > > p array.size # => 0 > > > > class MyEnumerable > > include Enumerable > > > > end > > > > foo = MyEnumerable.new > > foo.each_with_index # doesn't raise, the method is defined > > > > Hi Andrea, > > Thank you very much. So the receiver can be omitted when the method is > called within a class, right? > > Li