Hi
There is an example for this here:
http://github.com/andreasronge/neo4j/blob/master/test/neo4j/node_mixin_spec.rb
You need to call super first to initialize the node (I think).
I think the following should work:
class Event
include Neo4j::NodeMixin
property :name, :time
def initialize(name)
super
self.name = name
end
end
The initialize method is called both when loading the node from
filesystem and when creating a new node.
There is a method that is only called when creating the object: init_node
So maybe this is better:
class Event
include Neo4j::NodeMixin
property :name, :time
def init_node(*args)
self.name = args[0]
end
end
/Andreas