Method: Sequel::Dataset::DeprecatedSingletonClassMethods#with_extend
- Defined in:
- lib/sequel/dataset/deprecated_singleton_class_methods.rb
permalink #with_extend(*mods, &block) ⇒ Object
Extend the cloned of the receiver with the given modules, instead of the default approach of creating a subclass of the receiver’s class and including the modules into that.
19 20 21 22 23 24 |
# File 'lib/sequel/dataset/deprecated_singleton_class_methods.rb', line 19 def with_extend(*mods, &block) c = _clone(:freeze=>false) c.extend(*mods) unless mods.empty? c.extend(Sequel.set_temp_name(DatasetModule.new(&block)){"Sequel::Dataset::_DatasetModule(#{block.source_location.join(':')})"}) if block c.freeze end |