instance method
define_method_attribute=
Ruby on Rails 5.2.8.1
Since v5.2.8.1 PrivateSignature
define_method_attribute=(name)
No documentation comment.
Parameters
-
namereq
Source
# File activemodel/lib/active_model/attributes.rb, line 31
def define_method_attribute=(name)
safe_name = name.unpack("h*".freeze).first
ActiveModel::AttributeMethods::AttrNames.set_name_cache safe_name, name
generated_attribute_methods.module_eval <<-STR, __FILE__, __LINE__ + 1
def __temp__#{safe_name}=(value)
name = ::ActiveModel::AttributeMethods::AttrNames::ATTR_#{safe_name}
write_attribute(name, value)
end
alias_method #{(name + '=').inspect}, :__temp__#{safe_name}=
undef_method :__temp__#{safe_name}=
STR
end
Defined in activemodel/lib/active_model/attributes.rb line 31
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveModel::Attributes::ClassMethods