class method
self.method_added
Ruby on Rails 7.2.3
Since v7.2.3 PrivateSignature
self.method_added(name)
No documentation comment.
Parameters
-
namereq
Source
# File activesupport/lib/active_support/current_attributes.rb, line 186
def method_added(name)
super
# We try to generate instance delegators early to not rely on method_missing.
return if name == :initialize
# If the added method isn't public, we don't delegate it.
return unless public_method_defined?(name)
# If we already have a class method by that name, we don't override it.
return if singleton_class.method_defined?(name) || singleton_class.private_method_defined?(name)
Delegation.generate(singleton_class, [name], to: :instance, as: self, nilable: false)
end
Defined in activesupport/lib/active_support/current_attributes.rb line 186
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::CurrentAttributes