Class: Domain::Equalizer
- Inherits:
-
Module
- Object
- Module
- Domain::Equalizer
- Defined in:
- lib/domain/support/equalizer.rb
Defined Under Namespace
Modules: Methods
Instance Method Summary collapse
-
#initialize(components = nil, &bl) ⇒ Equalizer
constructor
private
Creates an Equalizer instance.
Constructor Details
#initialize(components = nil, &bl) ⇒ Equalizer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Creates an Equalizer instance.
13 14 15 16 17 18 19 20 21 |
# File 'lib/domain/support/equalizer.rb', line 13 def initialize(components = nil, &bl) extractor = case components when NilClass then bl when Symbol then proc{ [ send(components) ] } when Array then proc{ components.map{|n| send(n)} } end define_method(:equality_components, &extractor) module_eval{ include(Methods) } end |