Sha256: a17ba7f048ec997ec3953a63e9216f766ecfbabcef884d46be57b1c93ec052e3

Contents?: true

Size: 387 Bytes

Versions: 1

Compression:

Stored size: 387 Bytes

Contents

# 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
  
  def id
    getId
  end
  
  # Example:
  #    node[:name] #=> 'Matt'
  #
  def [](arg)
    get_property(arg.to_s)
  end
  
  # Example:
  #    node[:name] = 'Matt'
  #
  def []=(arg, value)
    set_property(arg.to_s, value)
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
neo4jr-simple-0.1.0 lib/neo4jr/node_extension.rb