module Draper::AutomaticDelegation
def delegatable?(method)
- Private: -
def delegatable?(method) return if self.class.private_method_defined?(method, false) object.respond_to?(method) end
def delegatable?(method)
- Private: -
def delegatable?(method) return if private_methods(false).include?(method) object.respond_to?(method) end
def method_missing(method, *args, &block)
the parent decorator class. If no method exists on the parent class, it will then try
method calls to `object` as well. Calling `super` will first try to call the method on
Delegates missing instance methods to the source object. Note: This will delegate `super`
def method_missing(method, *args, &block) unless delegatable?(method) ethod, *args, &block)
def respond_to_missing?(method, include_private = false)
Checks if the decorator responds to an instance method, or is able to
def respond_to_missing?(method, include_private = false) super || delegatable?(method) end