From: Junayeed Ahnaf Nirjhor Date: 2011-12-18T00:41:30+09:00 Subject: Re: def initialize --------------070600020303030404070002 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 12/17/2011 09:33 PM, Isaac Sanders wrote: > I will answer your question, but please read up on ruby before asking these > questions. They are fairly elementary if you take the time to understand > the language. > > the Initialize method is the constructor. > > class methods are called like this: ClassName.method_name > > you can write them like this: > > def self.method_name > end > > instance methods are methods on instances of a class > > a class variable is a variable that is the same throughout the class (the > syntax is @@class_variable) > > method variables... They could mean the parameters you pass in, or local > variables you create in a method. > > On Sat, Dec 17, 2011 at 10:03 AM, Junayeed Ahnaf Nirjhor< > zombiegenerator@aol.com> wrote: > >> Hello, >> >> Sometimes we see on code that there's something like, >> >> def initialize >> --------------------- >> end >> >> is written. What does it do? Also, what is class method and instance >> method? What is class variable& method variable? >> >> >> I'm a noob. so, please will anyone answer? >> -- >> Junayeed Ahnaf Nirjhor >> // >> > > thanks for the explanation -- Junayeed Ahnaf Nirjhor //r --------------070600020303030404070002--