Module: Cequel::Util::Forwardable

Overview

Rails defines the delegate method directly on the Module class, meaning that ‘Forwardable#delegate` overrides it any time a class extends Forwardable.

This module provides the methods Cequel uses from Forwardable, specifically #def_delegator and #def_delegators, but reverts the implementation of #delegate back to the one defined by ActiveSupport.

Instance Method Summary collapse

Instance Method Details

#delegate(*args, &block) ⇒ Object



68
69
70
71
# File 'lib/cequel/util.rb', line 68

def delegate(*args, &block)
  return super if args.one?
  Module.instance_method(:delegate).bind(self).call(*args, &block)
end