dstautberg/Test-App — comment on commit dda7ea3621cd876549442552ac9e37864bc30a7c
File: show.rb line 32
By dstautberg:

I basically was treating it as a factory method or constructor for Show instances. But you're right, a Show instances could just be a hash, and then I wouldn't have to convert it to JSON manually.

I guess I was thinking of it in terms of ActiveRecord models, since in a real-world app the scraped data would probably be cached in a database.
You can see the only method that's called by the controller is Show.list, which is similar to doing an ActiveRecord Show.all.

The other two Show.from_* methods I basically split out so I could unit test them separately as I was getting things working, but making a method public just for a unit test is a usually considered a code smell, so I would put that on the to-do list to refactor.