Flowdock
method

define_method_attribute=

Importance_0
v7.0.0 - Show latest stable - 0 notes - Class: ClassMethods
define_method_attribute=(name, owner:) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activemodel/lib/active_model/attributes.rb, line 46
        def define_method_attribute=(name, owner))
          ActiveModel::AttributeMethods::AttrNames.define_attribute_accessor_method(
            owner, name, writer: true,
          ) do |temp_method_name, attr_name_expr|
            owner.define_cached_method("#{name}=", as: temp_method_name, namespace: :active_model) do |batch|
              batch <<
                "def #{temp_method_name}(value)" <<
                "  _write_attribute(#{attr_name_expr}, value)" <<
                "end"
            end
          end
        end
Register or log in to add new notes.