These are chat archives for dry-rb/chat

7th
Nov 2017
Rafael George
@cored
Nov 07 2017 15:40
hi
how can I change the default constructor of a dry-struct custom type
I want to compose an xml with different types however there is a case in which I need to swap one particular type definition with another in which case I was planning on using DI for such thing
I'm currently using a defined factory method however I'm passing an object to the factory and then the factory knows how to retrieve the data to populate each individual attribute of the struct
I think it would be easier for me to define a constructor that knows those details extract the data and then pass it around, so I don't have to leave that logic in the initialization stage at the factory method level
does this make sense?
I'm doing that currently
maybe I should be explicit about what I want from the top level client of this types
Rafael George
@cored
Nov 07 2017 15:46
also is there a way to extend a predefined type ?
so I can swap it's attributes ?