orchestrate-io/orchestrate-ruby — pull request #71 by mattly (2014-07-09 00:40:02+00:00)
Title: Mattly/61 relations

I did the graph stuff before the refs/events because, on further thought, it was easier than either of the other two and there's a pattern in this interface I wanted to explore on a smaller scale first.

Here's my interface for the graph stuff, thoughts?
```ruby
item = app[:items][:someitem]
siblings = item.relations[:siblings] # as a standin against typing `item.relations[:siblings]` all the time, I call this a 'RelationStem'
siblings << other_kv_item # :<< and :push are aliased, both take either a KV object or a name/key pair
siblings.push('things', 'a-thing')
siblings.map {|kv| [kv.collection_name, kv.key, kv.ref] }
siblings.delete(other_kv_item) # this takes either a KV object or name/key pair similar to #push

# for multiple relationship traversal
item.relations[:siblings][:children][:children]
# this is a 'Traversal', the enumeration on RelationStem defers to this, but you cannot add or delete from a traversal
```

TODO: docs