Module: Kernel
- Defined in:
- lib/concerning/extension.rb
Instance Method Summary collapse
-
#concern(topic, &module_definition) ⇒ Object
A low-cruft shortcut to define a concern.
Instance Method Details
#concern(topic, &module_definition) ⇒ Object
A low-cruft shortcut to define a concern.
concern :EventTracking do
...
end
module EventTracking
extend ActiveSupport::Concern
...
end
137 138 139 140 141 142 |
# File 'lib/concerning/extension.rb', line 137 def concern(topic, &module_definition) const_set topic, Module.new { extend ActiveSupport::Concern module_eval(&module_definition) } end |