Method: ActiveSupport::CodeGenerator::MethodSet#apply

Defined in:
activesupport/lib/active_support/code_generator.rb

#apply(owner, path, line) ⇒ Object



28
29
30
31
32
33
34
35
36
37
# File 'activesupport/lib/active_support/code_generator.rb', line 28

def apply(owner, path, line)
  unless @sources.empty?
    @cache.module_eval("# frozen_string_literal: true\n" + @sources.join(";"), path, line)
  end
  @canonical_methods.clear

  @methods.each do |as, canonical_name|
    owner.define_method(as, @cache.instance_method(canonical_name))
  end
end