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

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

Instance Method Summary collapse

Instance Method Details

#attributes(new_schema) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/dry/struct/setters.rb', line 28

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