Module | Virtus::ValueObject::ClassMethods |
In: |
lib/virtus/value_object.rb
|
Define an attribute on the receiver
The Attribute will have private writer methods (eg., immutable instances)
and be used in equality/equivalence comparisons
@example
class GeoLocation include Virtus::ValueObject attribute :latitude, Float attribute :longitude, Float end
@see Virtus::ClassMethods.attribute
@return [self]
@api public
Define and include a module that provides Value Object semantics
Included module will have inspect, eql?, #== and hash methods whose definition is based on the keys argument
@example
virtus_class.equalizer
@return [Equalizer]
An Equalizer module which defines #inspect, #eql?, #== and #hash for instances of this class
@api public