module Draper::AutomaticDelegation
Public Instance Methods
Source
# File lib/draper/automatic_delegation.rb, line 9 def method_missing(method, *args, &block) return super unless delegatable?(method) object.send(method, *args, &block) end
Calls superclass method
Source
# File lib/draper/automatic_delegation.rb, line 17 def respond_to_missing?(method, include_private = false) super || delegatable?(method) end
Checks if the decorator responds to an instance method, or is able to proxy it to the source object.
Calls superclass method
Private Instance Methods
Source
# File lib/draper/automatic_delegation.rb, line 24 def delegatable?(method) return if self.class.private_method_defined?(method, false) object.respond_to?(method) end
@private