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
Post a Comment