Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Relationships have properties, so they should also have a 'props' hash
  • Loading branch information
Martin Kleppmann committed Jun 17, 2009
1 parent 1ea74ef commit 4c363fb
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/neo4j/mixins/relationship.rb
Expand Up @@ -89,6 +89,22 @@ def get_property(key)
@internal_r.getProperty(key)
end

# Returns a hash of all properties.
#
# ==== Returns
# Hash:: property key and property value
#
# :api: public
def props
ret = {"id" => neo_relationship_id}
iter = @internal_r.getPropertyKeys.iterator
while (iter.hasNext) do
key = iter.next
ret[key] = @internal_r.getProperty(key)
end
ret
end

# Returns the given property
#
# :api: public
Expand Down

0 comments on commit 4c363fb

Please sign in to comment.