Skip to content
Tags

,

Tip about calling methods within a method

March 16, 2011

Sometimes you want to call a method within a method

class Klass

def method_1

method_2 # call to method 2

end

end

Now this can be done only if both are instance methods or both are class methods. they way method 1 is defined it is an instance method and so, method_2 should also be an instance method and not a class method.

Advertisements

From → Uncategorized

Leave a Comment

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: