Class: Aequitas::ValueObject::Equalizer
- Inherits:
-
Module
- Object
- Module
- Aequitas::ValueObject::Equalizer
- Defined in:
- lib/aequitas/support/value_object.rb
Instance Attribute Summary collapse
-
#keys ⇒ Array(Symbol)
readonly
List of methods that will be used to compile #inspect, #eql?, #== and #hash methods.
Instance Method Summary collapse
-
#compile ⇒ self
Compile the equalizer methods based on #keys.
-
#initialize(keys) ⇒ Equalizer
constructor
A new instance of Equalizer.
Constructor Details
#initialize(keys) ⇒ Equalizer
Returns a new instance of Equalizer.
35 36 37 |
# File 'lib/aequitas/support/value_object.rb', line 35 def initialize(keys) @keys = keys end |
Instance Attribute Details
#keys ⇒ Array(Symbol) (readonly)
List of methods that will be used to compile #inspect,
#eql?, #== and #hash methods
33 34 35 |
# File 'lib/aequitas/support/value_object.rb', line 33 def keys @keys end |
Instance Method Details
#compile ⇒ self
Compile the equalizer methods based on #keys
42 43 44 45 46 47 48 49 |
# File 'lib/aequitas/support/value_object.rb', line 42 def compile define_inspect_method define_eql_method define_equivalent_method define_hash_method self end |