Implement Representable::Object#to_object#266
Implement Representable::Object#to_object#266elShiaLabeouf wants to merge 4 commits intotrailblazer:masterfrom
Conversation
0d0e09c to
d81728a
Compare
README.md
Outdated
| - `Representable::JSON#to_json` | ||
| - `Representable::JSON#to_hash` (provides a hash instead of string) | ||
| - `Representable::Hash#to_hash` | ||
| - `Representable::Object#to_object` (provides a Struct-based object) |
There was a problem hiding this comment.
What if we make the object type configurable and Struct is one of the possible targets?
There was a problem hiding this comment.
I like this. But having a to_struct shortcut is good too.
There was a problem hiding this comment.
I agree, module Struct and to_struct fit more, as to_object is too vague. Moved the new code to a new module.
Frankly, I'm kinda confused about configurable object type with Struct as one of the possible targets. What other possible target there could be..? OpenStruct / AnyCustomUserClassPassedAsArgument? I feel like Struct is sufficient and there's no need for other options
There was a problem hiding this comment.
Object can return the original object such as ActiveRecord model or a Poro with it attributes set.
There was a problem hiding this comment.
Frankly, I'm kinda confused about
configurable object typewith Struct as one of the possible targets. What other possible target there could be..?
Imagine a project with Domain::Song, Domain::Song::Duration, Domain::Artist, etc. People might want to transform an object to another domain object?!
c8ce696 to
f548bd1
Compare
f548bd1 to
fcf985d
Compare
Please see Issue#267