Take the object being set and store it in a method. This gives us automatic
inheritance behavior, without having to store the object in an instance
variable and look up the superclass chain manually.
# File activesupport/lib/active_support/core_ext/class/delegating_attributes.rb, line 32
def _stash_object_in_method(object, method, instance_reader = true)
singleton_class.remove_possible_method(method)
singleton_class.send(:define_method, method) { object }
remove_possible_method(method)
define_method(method) { object } if instance_reader
end