module Draper::AutomaticDelegation
Public Instance Methods
delegatable?(method)
click to toggle source
@private
# File lib/draper/automatic_delegation.rb, line 22 def delegatable?(method) return if private_methods(false).include?(method) object.respond_to?(method) end
method_missing(method, *args, &block)
click to toggle source
Calls superclass method
# 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
respond_to_missing?(method, include_private = false)
click to toggle source
Checks if the decorator responds to an instance method, or is able to proxy it to the source object.
Calls superclass method
# File lib/draper/automatic_delegation.rb, line 17 def respond_to_missing?(method, include_private = false) super || delegatable?(method) end