Method: ContextBuilder.extended

Defined in:
lib/context_builder.rb

.extended(base_mod) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/context_builder.rb', line 7

def self.extended(base_mod)
  base_mod.module_eval do
    @__context_attrs = {}
  end

  orig_included = base_mod.method(:included)
  base_mod.define_singleton_method(:included) do |base_class|
    BaseClassDefiner.new(base_class).define_all(@__context_attrs)
    orig_included.call(base_class)
  end
end