Skip to content

Using a module instead of a class

June 19, 2013

Sometimes I write code in a class which I feel might be better written in a module. I don’t initialize the class and have a hard time imagining it as a object. It mostly houses procedural code.

I found this SO link which gives a good answer: http://stackoverflow.com/questions/2671545/when-to-use-a-module-and-when-to-use-a-class

also this might be useful : http://matt.aimonetti.net/posts/2012/07/30/ruby-class-module-mixins/

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: