method
method_added
v7.2.3 -
Show latest stable
- Class:
ActiveSupport::CurrentAttributes
method_added(name)private
No documentation available.
# 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