module Enrich::AutoDelegate::ClassMethods
Public Instance Methods
before_remove_const()
click to toggle source
Avoids reloading the model class when ActiveSupport clears autoloaded dependencies in development mode.
# File lib/enrich/auto_delegate.rb, line 46 def before_remove_const end
delegatable?(method)
click to toggle source
@private
# File lib/enrich/auto_delegate.rb, line 40 def delegatable?(method) object_class? && object_class.respond_to?(method) end
method_missing(method, *args, &block)
click to toggle source
Proxies missing class methods to the source class.
Calls superclass method
# File lib/enrich/auto_delegate.rb, line 27 def method_missing(method, *args, &block) return super unless delegatable?(method) object_class.send(method, *args, &block) end
respond_to_missing?(method, include_private = false)
click to toggle source
Checks if the decorator responds to a class method, or is able to proxy it to the source class.
Calls superclass method
# File lib/enrich/auto_delegate.rb, line 35 def respond_to_missing?(method, include_private = false) super || delegatable?(method) end