lib/neo4jr/node_extension.rb in neo4jr-simple-0.1.0 vs lib/neo4jr/node_extension.rb in neo4jr-simple-0.1.3

- old
+ new

@@ -1,22 +1,12 @@ -# Extends the Node class with a hash style accessor methods to the node's properties -org.neo4j.api.core.Node.java_class.ruby_class.class_eval do +org.neo4j.api.core.Node.java_class.ruby_class.class_eval do def id getId end - - # Example: - # node[:name] #=> 'Matt' - # - def [](arg) - get_property(arg.to_s) + + def to_hash + extra_values = {:node_id => self.getId, :kind => 'Node'} + properties.merge extra_values end - - # Example: - # node[:name] = 'Matt' - # - def []=(arg, value) - set_property(arg.to_s, value) - end - -end + +end \ No newline at end of file