I'm a freelance web developer and Rubyist. I'm the author of The Rails and Hotwire Codex (https://railsandhotwirecodex.com) and the co-host of Just A Spec.
I think the main advantage would be you'd have fine grained control over which attributes are written to the YAML representation. I believe .to_json would write out all the instance variables right? That might not always be desireable ....
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I think the main advantage would be you'd have fine grained control over which attributes are written to the YAML representation. I believe
.to_json
would write out all the instance variables right? That might not always be desireable ....