document and fix wrong variable access
authorPablo Fernandez <pablo@littleq.net>
Tue, 27 Mar 2012 22:16:03 +0000 (19:16 -0300)
committerPablo Fernandez <pablo@littleq.net>
Tue, 27 Mar 2012 22:16:03 +0000 (19:16 -0300)
README.rdoc
lib/neography/relationship.rb

index 83254fee12eae10ddd1a00d7df2db21726d6573d..51665046ba73683b3ddc0de2c84b8b9ae9ecd388 100644 (file)
@@ -270,6 +270,7 @@ The Neo4j ID is available by using node.neo_id .
   new_rel.start_node                                                   # Get the start/from node of a relationship
   new_rel.end_node                                                     # Get the end/to node of a relationship
   new_rel.other_node(n2)                                               # Get the other node of a relationship
+  new_rel.attributes                                                   # Get the attributes of the relationship as an array
 
   existing_rel = Neography::Relationship.load(12)                      # Get an existing relationship by id
   existing_rel.del                                                     # Delete a relationship
index febcc9b409a9065a0953783ee6b8b865e7b99bae..24d47b83e34aaf6548cc311f42f6cdd959ad07c7 100644 (file)
@@ -58,7 +58,7 @@ module Neography
     
     def attributes
       attrs = self.methods - OpenStruct.instance_methods - Neography::Relationship.instance_methods
-      attrs.values_at(*self.each_index.select {|i| i.odd?})
+      attrs.values_at(*attrs.each_index.select {|i| i.even?})
     end
 
     def other_node(node)
@@ -70,4 +70,4 @@ module Neography
     end
 
   end
-end
\ No newline at end of file
+end