riak-ripple / ripple

A rich Ruby modeling layer for Riak, Basho's distributed database
Other
619 stars 152 forks source link

RObject#siblings has return type ([RObject] | RObject) #239

Closed aphyr closed 12 years ago

aphyr commented 12 years ago

I think a pluralized method returning a list like #siblings should always return an array. As it stands, when only one sibling exists it returns that RObject directly, which makes it difficult to write code using #siblings without case statements.

@seancribbs, @adamhunter, @myronmarston, @duff, @ntalbott, thoughts? Shall I change #siblings to return [self] when no conflict is present?

myronmarston commented 12 years ago

That makes sense to me.

seancribbs commented 12 years ago

Do it. This will be the first step toward making it be "#values" and having a separate Value class that is simply delegated to at the top level RObject.

On Tue, Nov 15, 2011 at 4:07 PM, Kyle Kingsbury < reply@reply.github.com

wrote:

I think a pluralized method returning a list like #siblings should always return an array. As it stands, when only one sibling exists it returns that RObject directly, which makes it difficult to write code using

siblings without case statements.

@seancribbs, @adamhunter, @myronmarsten, @duff, @ntalbott, thoughts? Shall I change #siblings to return [self] when no conflict is present?


Reply to this email directly or view it on GitHub: https://github.com/seancribbs/ripple/issues/239

Sean Cribbs sean@basho.com Developer Advocate Basho Technologies, Inc. http://www.basho.com/

ntalbott commented 12 years ago

Yes please!

duff commented 12 years ago

+1

aphyr commented 12 years ago

Coming up shortly. :)

aphyr commented 12 years ago

Fixed by 432b3828f99463fcea296280adf58086af494361