Difference between adding instance methods with Active Concern and a regular ruby module? -


what difference between adding instance methods whith active concern , through normal ruby def keyword on module?

module monsterconcern   extend activesupport::concern    included     def engage_rage     end      def chew_bones     end   end end 

and

module monsterconcern   def engage_rage   end    def chew_bones   end end 

as far know there no difference if thing interested in instance methods.

the activesupport::concern advantage ability define class methods, , handle nasty module interdependencies better (related calling class methods in included block).

you can read more here: http://api.rubyonrails.org/classes/activesupport/concern.html


Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -