On May 05, 2006, at 7:51 pm, Benjamin Pyles wrote:

> def self.login(name,password)
> # code here
> end
>
> def try_to_login
>   User.login(self.name, self.password)
> end
>
> #Both functions belong to a class Named User
>
> Now I understand the self.name and self password reference the calling
> object. However, I am still trying to figure out why in this  
> example the
> function is prefixed with self.

If by "the function" you mean "def self.login" it's to make it a  
class method, rather than a method that applies to objects of that  
class.  ie you call "User.login" and not "u = User.new; u.login".

Ashley