# Definition of methods: self

**URL:** <https://www.ruby-forum.com/t/definition-of-methods-self/97635>\
**Category:** Ruby\
**Created:** [July 8, 2006, 11:15pm UTC](https://www.ruby-forum.com/t/definition-of-methods-self/97635 "2006-07-08T23:15:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![damaris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/2bfe46/32.png) [@damaris](https://www.ruby-forum.com/u/damaris)\
**Post date:** [July 8, 2006, 11:15pm UTC](https://www.ruby-forum.com/t/definition-of-methods-self/97635/1 "2006-07-08T23:15:25Z")

</div>

In Why’s poignant guide to Ruby some examples appear where he defines a  
class “class LotteryTicket”, and then he defines a method “def  
self.new\_random”, or “def LotteryDraw.buy(…)”; that is, before the name  
of the method, the name of the class appears (the name or the keyword  
“self”). However, in other methods in the other classes, the class name  
is not set before the name of the method. Explanations? 😃
