module ActiveModel::AttributeMethods::ClassMethods

def define_proxy_call(code_generator, name, target, parameters, *call_args, namespace:)

if the called name cannot be compiled.
using the given `extra` args. This falls back on `send`
Define a method `name` in `mod` that dispatches to `send`
def define_proxy_call(code_generator, name, target, parameters, *call_args, namespace:)
  mangled_name = name
  unless NAME_COMPILABLE_REGEXP.match?(name)
    mangled_name = "__temp__#{name.unpack1("h*")}"
  end
  code_generator.define_cached_method(name, as: mangled_name, namespace: :"#{namespace}_#{target}") do |batch|
    call_args.map!(&:inspect)
    call_args << parameters if parameters
    body = if CALL_COMPILABLE_REGEXP.match?(target)
      "self.#{target}(#{call_args.join(", ")})"
    else
      call_args.unshift(":'#{target}'")
      "send(#{call_args.join(", ")})"
    end
    modifier = parameters == FORWARD_PARAMETERS ? "ruby2_keywords " : ""
    batch <<
      "#{modifier}def #{mangled_name}(#{parameters || ''})" <<
      body <<
      "end"
  end
end