From: Matt Mongeau Date: 2013-02-23T04:14:38+09:00 Subject: Re: Class method's has a fuzzy meaning and a sharp meaning --e89a8f6429a41243d004d6550090 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable All I think this is just talking about the contexts of a class method (hard to say without knowing what's being talked about currently in the book). For example he's saying the following are referred to as class methods class Foo def self.bar # Sharply, a class method is defined, not just called, directly on a Class object. self is the class Foo here puts "bar" end end Foo.bar # Fuzzily, any method that gets called directly on a Class object is a class method. Not sure why he uses these terms, they seem more confusing to me than they are worth. 2013/2/21 Xavier R. > David A. Black in his book - "The Well-Grounded Rubyist" > > "So class method has a fuzzy meaning and a sharp meaning. Fuzzily, any > method that gets called directly on a Class object is a class method. > Sharply, a class method is defined, not just called, directly on a Class > object. You=92ll hear it used both ways, and as long as you=92re aware of > the underlying engineering and can make the sharp distinctions when you > need to, you=92ll be fine." > > As a beginner couldn't take the concept at all. So anyone out there - > could you help me the above with some examples? > > -- > Posted via http://www.ruby-forum.com/. > --e89a8f6429a41243d004d6550090 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable
All I think this is just talking about the contexts of a c= lass method (hard to say without knowing what's being talked about curr= ently in the book). For example he's saying the following are referred = to as class methods

class Foo
=A0 def self.bar #=A0Sharply, a class metho= d is defined, not just called, directly on a Class=A0object. self is the class Foo = here
=A0 =A0 puts "bar"
=A0 end
end

Foo.bar #=A0Fuzzily, any=A0method that gets called d= irectly on a Class object is a class method.

=
Not sure why he uses these terms, they seem more confusing to me t= han they are worth.


2013/2/= 21 Xavier R. <lists@ruby-forum.com>
David A. Black in his book - "The Well-Grounded Rubyist"

"So class method has a fuzzy meaning and a sharp meaning. Fuzzily, any=
method that gets called directly on a Class object is a class method.
Sharply, a class method is defined, not just called, directly on a Class object. You=92ll hear it used both ways, and as long as you=92re aware of the underlying engineering and can make the sharp distinctions when you
need to, you=92ll be fine."

As a beginner couldn't take the concept at all. So anyone out there - could you help me the above with some examples?

--
Posted via http://= www.ruby-forum.com/.

--e89a8f6429a41243d004d6550090--