module Draper::AutomaticDelegation::ClassMethods
Public Instance Methods
before_remove_const()
click to toggle source
@private Avoids reloading the model class when ActiveSupport clears autoloaded dependencies in development mode.
# File lib/draper/automatic_delegation.rb, line 50 def before_remove_const end
delegatable?(method)
click to toggle source
@private
# File lib/draper/automatic_delegation.rb, line 43 def delegatable?(method) object_class? && object_class.respond_to?(method) end
method_missing(method, *args, &block)
click to toggle source
Calls superclass method
# File lib/draper/automatic_delegation.rb, line 30 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/draper/automatic_delegation.rb, line 38 def respond_to_missing?(method, include_private = false) super || delegatable?(method) end