bigcommerce/bigcommerce-api-ruby — pull request #67 by mastfish (2013-11-20 03:36:06+00:00)
Title: RFC on OO-ifyng, idiomizing

:bangbang: This is only a request for comment, do not merge. :bangbang:

This is intended as a glimpse into the direction I'm taking with this, and to open the floor for suggestion on improvement.

I've hacked around a bit with the gem to work on objects rather than hashes. Currently only applied to the products resource, but I think this is much nicer than passing around Hashes.

I'm not sure about defining resource accessors whenever we spot them in the JSON, but we definitely need some nice way of querying sub-resources.

Currently pondering returning an enumerator from collection APIs to abstract away from pagination. Idea being you'd call products.each, and it would keep feeding you products from the API, paginating as necessary.

Thoughts?