Module: Avromatic::Model::ValueObject
- Defined in:
- lib/avromatic/model/value_object.rb
Overview
This module is used to override the comparisons defined by Virtus::Equalizer which is pulled in by Virtus::ValueObject.
Instance Method Summary collapse
Instance Method Details
#eql?(other) ⇒ Boolean Also known as: ==
7 8 9 |
# File 'lib/avromatic/model/value_object.rb', line 7 def eql?(other) other.instance_of?(self.class) && attributes == other.attributes end |
#hash ⇒ Object
12 13 14 |
# File 'lib/avromatic/model/value_object.rb', line 12 def hash attributes.hash end |
#inspect ⇒ Object
16 17 18 |
# File 'lib/avromatic/model/value_object.rb', line 16 def inspect "#<#{self.class.name} #{attributes.map { |k, v| "#{k}: #{v.inspect}" }.join(', ')}>" end |
#to_s ⇒ Object
20 21 22 |
# File 'lib/avromatic/model/value_object.rb', line 20 def to_s format('#<%s:0x00%x>', self.class.name, object_id.abs * 2) end |