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