Module: Neo4j::NodeMixin

Includes:
Core::Index, Wrapper::Equal, Wrapper::HasN::InstanceMethods, Wrapper::NodeMixin::Delegates, Wrapper::NodeMixin::Initialize, Wrapper::Property::InstanceMethods, Wrapper::Rule::InstanceMethods
Defined in:
lib/neo4j/node_mixin.rb

Overview

This mixin is used to wrap Neo4j Java Nodes in Ruby objects.

Class Method Modules

Instance Method Modules

Examples:

Declare and Use a Lucene Index


class Contact
   include Neo4j::NodeMixin
   property :phone, :index => :exact
end

# Find an contact with a phone number
Contact.find('phone: 12345').first #=> a phone object !

Class Method Summary (collapse)

Methods included from Wrapper::Equal

#eql?

Methods included from Wrapper::Property::InstanceMethods

#attributes

Methods included from Wrapper::Rule::InstanceMethods

#trigger_rules

Methods included from Wrapper::HasN::InstanceMethods

#_decl_rels_for

Methods included from Wrapper::NodeMixin::Initialize

#_java_node, #init_on_create, #init_on_load, #wrapper

Methods included from Wrapper::NodeMixin::Delegates

#:==, #:[], #:[]=, #_node, #_nodes, #_rel, #_rels, #both, #del, #eql?, #equal?, #eval_paths, #exist?, #expand, #getId, #getRelationships, #get_property, #incoming, #neo_id, #node, #nodes, #outgoing, #property?, #property_keys, #props, #rel, #rel?, #rels, #remove_property, #set_property, #unique, #update

Class Method Details

+ (Object) included(klass)



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/neo4j/node_mixin.rb', line 37

def self.included(klass)
  klass.extend Neo4j::Wrapper::ClassMethods
  klass.extend Neo4j::Wrapper::NodeMixin::ClassMethods
  klass.extend Neo4j::Wrapper::Property::ClassMethods
  klass.extend Neo4j::Wrapper::HasN::ClassMethods
  klass.extend Neo4j::Core::Index::ClassMethods
  klass.extend Neo4j::Wrapper::Find
  klass.extend Neo4j::Wrapper::Rule::ClassMethods
  klass.send(:include, Neo4j::Wrapper::Rule::Functions)
  klass.setup_node_index

  def klass.inherited(sub_klass)
    setup_neo4j_subclass(sub_klass)
    super
  end

  super
end