These are chat archives for dry-rb/chat

9th
Nov 2018
Tonni Tølbøll Lund Aagesen
@ta
Nov 09 2018 15:01
require "dry-struct"

module Types
  include Dry::Types.module
end

class User < Dry::Struct
  attr_writer :name

  attribute :name, Types::Strict::String.optional.default(nil)
end

u = User.new
puts u.inspect
u.name = "Steve"
puts u.inspect
The attr_writer statement used to work in dry-struct v0.4 but it doesn't work in v0.6 - is this by design?