Module: Dry::Struct::Setters::ClassMethods

Defined in:
lib/dry/struct/setters.rb

Instance Method Summary collapse

Instance Method Details

#attributes(new_schema) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/dry/struct/setters.rb', line 20

def attributes(new_schema)
  super.tap do
    new_schema.each do |attribute, type|
      Dry::Struct::Setters.define_setter_for(struct: self, attribute: attribute, type: type)
    end
  end
end