instance method define_method_attribute=

Ruby on Rails 6.0.6

Since v5.2.8.1 Private

Available in: v5.2.8.1 v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

define_method_attribute=(name)

No documentation comment.

Parameters

name req
Source
# File activemodel/lib/active_model/attributes.rb, line 45
        def define_method_attribute=(name)
          ActiveModel::AttributeMethods::AttrNames.define_attribute_accessor_method(
            generated_attribute_methods, name, writer: true,
          ) do |temp_method_name, attr_name_expr|
            generated_attribute_methods.module_eval <<-RUBY, __FILE__, __LINE__ + 1
              def #{temp_method_name}(value)
                name = #{attr_name_expr}
                write_attribute(name, value)
              end
            RUBY
          end
        end

Defined in activemodel/lib/active_model/attributes.rb line 45 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveModel::Attributes::ClassMethods

Type at least 2 characters to search.

↑↓ navigate · open · esc close