instance method
guard_private_attribute_method!
Ruby on Rails 3.1.12
Since v3.0.20 Last seen in v3.1.12 PrivateAvailable in: v3.0.20 v3.1.12
Signature
guard_private_attribute_method!(method_name, args)
prevent method_missing from calling private methods with #send
Parameters
-
method_namereq -
argsreq
Source
# File activemodel/lib/active_model/attribute_methods.rb, line 423
def guard_private_attribute_method!(method_name, args)
if self.class.private_method_defined?(method_name)
raise NoMethodError.new("Attempt to call private method `#{method_name}'", method_name, args)
end
end
Defined in activemodel/lib/active_model/attribute_methods.rb line 423
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveModel::AttributeMethods