Module: Aequitas::ValueObject
- Included in:
- ContextualRuleSet, Rule, Rule::Guard, Rule::SkipCondition, RuleSet, Violation
- Defined in:
- lib/aequitas/support/value_object.rb
Defined Under Namespace
Classes: Equalizer
Instance Attribute Summary collapse
-
#equalizer ⇒ Object
readonly
An Equalizer module which defines #inspect, #eql?, #== and #hash for instances of this class.
Instance Method Summary collapse
-
#equalize_on(*keys) ⇒ self
Define and include a module that provides Value Object semantics for this class.
Instance Attribute Details
#equalizer ⇒ Object (readonly)
An Equalizer module which defines #inspect, #eql?, #== and #hash for instances of this class
8 9 10 |
# File 'lib/aequitas/support/value_object.rb', line 8 def equalizer @equalizer end |
Instance Method Details
#equalize_on(*keys) ⇒ self
Define and include a module that provides Value Object semantics for
this class. Included module will have #inspect, #eql?, #== and #hash
methods whose definition is based on the _keys_ argument
20 21 22 23 24 25 26 |
# File 'lib/aequitas/support/value_object.rb', line 20 def equalize_on(*keys) @equalizer = Equalizer.new(keys) @equalizer.compile include @equalizer self end |