These are chat archives for dry-rb/chat
Next-gen ruby libs! » github.com/dry-rb » website: https://dry-rb.org » forum: https://discourse.dry-rb.org
#to_hash, and I wondered if anyone might know of a solution, or perhaps if it can be fixed in the gem itself? https://gist.github.com/kj/35af5c95c804b760c147ef57da8f0871
#to_hashimplicit hash conversion method
#to_hashclass for me is
Hanami::Entity, the one I'm passing it to is mine.
#to_his the more appropriate hash conversion method for those to implement, IMO
#initialize. For example, when the entity is an object I'm acting upon for all future calls using that instance (with varying arguments to
def initialize(my_entity:, **kwargs)
#callevery time you need it
#initialize, data goes into
#calland just passes through
#call, would you ever set instance variables, to avoid passing state all around as args to other methods (I think this feels dirty)?
#calldoes not mutate state in any way
#initialize. Just the convenience of having it all there and available at all times.