Module: Cequel::Util::Forwardable
- Includes:
- Forwardable
- Included in:
- Metal::DataSet, Metal::Keyspace, Metal::Logging, Metal::RequestLogger, Metal::Writer, Record, Record::AssociationCollection, Record::Associations::ClassMethods, Record::BelongsToAssociation, Record::Collection, Record::DataSetBuilder, Record::LazyRecordCollection, Record::Map, Record::Persistence, Record::Persistence::ClassMethods, Record::RecordSet, Record::Schema, Record::Schema::ClassMethods, Record::Scoped::ClassMethods, Schema::Keyspace, Schema::MigrationValidator, Schema::TableDescDsl, Schema::UpdateTableDSL
- Defined in:
- lib/cequel/util.rb
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 |