module Avromatic::Model::ValueObject

This module is used to override the comparisons defined by Virtus::Equalizer which is pulled in by Virtus::ValueObject.

Public Instance Methods

==(other)
Alias for: eql?
eql?(other) click to toggle source
# File lib/avromatic/model/value_object.rb, line 8
def eql?(other)
  other.instance_of?(self.class) && attributes == other.attributes
end
Also aliased as: ==
hash() click to toggle source
# File lib/avromatic/model/value_object.rb, line 13
def hash
  attributes.hash
end
inspect() click to toggle source
# File lib/avromatic/model/value_object.rb, line 17
def inspect
  "#<#{self.class.name} #{attributes.map { |k, v| "#{k}: #{v.inspect}" }.join(', ')}>"
end
to_s() click to toggle source
# File lib/avromatic/model/value_object.rb, line 21
def to_s
  format('#<%<class_name>s:0x00%<identifier>x>', class_name: self.class.name, identifier: object_id.abs * 2)
end