Skip to content

Project – Day4

December 22, 2010

In ruby every think is an object string, variable, all are object

i learn how to derive a class and methods

and to call back in out of class

types of variable -> local ,global, instance and class variable

using the @var=”car”  in the class method. It will instantly use the out of class using object to call method

how to access the local variable in out of class means using attr_reader :var and attr_writer or attr

attr_reader  —>  getter method

attr_writer  —-> putter method

att —-> It performs both getter and putter

and symbol (:passwd) once we mentioned the symbol does not change it

symbols are immutable strings are mutable

One Comment leave one →
  1. logesh permalink
    February 8, 2011 7:54 pm

    nice one!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: