Class: Dry::Data::Value

Inherits:
Struct
  • Object
show all
Defined in:
lib/dry/data/value.rb

Class Method Summary collapse

Methods inherited from Struct

#[], attribute, #initialize, new, schema, #to_hash

Constructor Details

This class inherits a constructor from Dry::Data::Struct

Class Method Details

.attributes(*args) ⇒ Object



12
13
14
15
# File 'lib/dry/data/value.rb', line 12

def self.attributes(*args)
  super
  equalizer.instance_variable_get('@keys').concat(schema.keys).uniq!
end

.equalizerObject



17
18
19
# File 'lib/dry/data/value.rb', line 17

def self.equalizer
  @equalizer
end

.inherited(klass) ⇒ Object



6
7
8
9
10
# File 'lib/dry/data/value.rb', line 6

def self.inherited(klass)
  super
  klass.instance_variable_set('@equalizer', Equalizer.new)
  klass.send(:include, klass.equalizer)
end