Class: Orthoses::ActiveSupport::CoreExt::Concerning
- Inherits:
-
Object
- Object
- Orthoses::ActiveSupport::CoreExt::Concerning
- Defined in:
- lib/orthoses/active_support/core_ext.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(loader) ⇒ Concerning
constructor
A new instance of Concerning.
Constructor Details
#initialize(loader) ⇒ Concerning
Returns a new instance of Concerning.
7 8 9 |
# File 'lib/orthoses/active_support/core_ext.rb', line 7 def initialize(loader) @loader = loader end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/orthoses/active_support/core_ext.rb', line 11 def call tracer = ::Orthoses::CallTracer::Lazy.new tracer.trace('Module::Concerning#concern') do @loader.call end.tap do |store| tracer.captures.each do |capture| base = capture.method.receiver base_name = ::Orthoses::Utils.module_name(base) or next topic = capture.argument[:topic] or next store["#{base_name}::#{topic}"].header = "module #{base_name}::#{topic}" end end end |