Skip to content

Commit

Permalink
Add a way to query the attributes of a relationship
Browse files Browse the repository at this point in the history
  • Loading branch information
pablof7z committed Mar 27, 2012
1 parent 122336a commit 49c253c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/neography/relationship.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ def del
def exist?
!self.start_node.neo_server.get_relationship(self.neo_id).nil?
end

def attributes
attrs = self.methods - OpenStruct.instance_methods - Neography::Relationship.instance_methods
attrs.values_at(*self.each_index.select {|i| i.odd?})
end

def other_node(node)
if node == @start_node
Expand Down

0 comments on commit 49c253c

Please sign in to comment.