instance method
define_method_attribute=
Ruby on Rails 6.0.6
Since v5.2.8.1 PrivateSignature
define_method_attribute=(name)
No documentation comment.
Parameters
-
namereq
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