RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Module in Ruby

Ruby has many strengths and is a very malleable language. Ruby can be written functionally or object oriented. I tend to lean toward the latter and find myself using a few different patterns regularly. One powerful tool Ruby provides is the use of Modules. You can learn how to use this tool by extending and including modules

Comments

Worth mentioning: if you are using rails then an interface for this pattern is provided for you via the ActiveSupport::Concern module:

http://api.rubyonrails.org/classes/ActiveSupport/Concern.html

With a few additional bells and whistles.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in