This adds #each, #size, #length, #count, and makes result Enumerable.
One note: I am running specs against cass 1.1. In order to get the specs to pass, I had to make sure that the keyspace check in setup_cassandra_connection in spec_helper was case insensitive. I did not include that in this pull request, but I certainly can if you are ok with it.
Added Result#each and mixed in Enumerable.
Makes result more friendly. The assumption is you usually want an array of hashes. If you don't, you can use fetch_array or whatever.
Make sure #size, #length, and #count work.
Ruby arrays and such typically respond to these. #rows doesn't feel obvious to me. I would think that would actually be an array of the rows, but I'm leaving it unchanged for backwards compatibility.
A few comments:
Thanks so much for the response. I maintain several gems and I know it takes time, so I appreciate your time.
Do you find yourself using one of the other fetch methods more often? Or all of them relatively equally?
I suppose we could just rename #each to #each_hash or something like that, but again, I would advocate picking the most common usage for #each and then just leaving the other fetch methods as is, including fetch_hash.
Maybe I'm wrong, I just went with my gut and what I have found myself wanting.
My use cases are way more towards the time-series end of things where arrays are more useful. I wish there were a useful way to ask users which is more common and do whatever that is but maybe since that's not practical, you should just refactor this (now that I've pulled in the other request) and have it your way. You wrote it after all :)
Closing in favor of #38.