Roshan Book

My Tech Notebook

Learning Ruby Part 5–More on Objects


In Ruby every thing is an Object.

When we write 12, it is actually an object of class called FixNum.

To find out what class objects belong to, use

.class

Method

 

Kernel methods are common methods,which any class can used.

Some examples of Kernel methods

puts

print

For kernel methods, we can directly write it, without mentioning class.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: