Module: Neo4j::RelationshipMixin

Includes:
Wrapper::Equal, Wrapper::Property::InstanceMethods, Wrapper::RelationshipMixin::Delegates, Wrapper::RelationshipMixin::Initialize
Defined in:
lib/neo4j/relationship_mixin.rb

Overview

Use this mixin to wrap Neo4j Relationship Java object. This mixin is similar to Neo4j::NodeMixin which wraps Neo4j::Node Java objects.

Friend.new(:knows, node_a, node_b, :strength => 3.14)
Friend.find(:strength => (2..5)).first

Class Method Modules

Examples:

class Friend
   include Neo4j::RelationshipMixin
   property :since, :type => Fixnum, :index => :exact
   property :strength, :type => Float
   property :location
 end

Class Method Summary (collapse)

Methods included from Wrapper::Equal

#eql?

Methods included from Wrapper::Property::InstanceMethods

#attributes

Methods included from Wrapper::RelationshipMixin::Delegates

#:==, #:[], #:[]=, #_end_node, #_other_node, #_start_node, #del, #end_node, #eql?, #equal?, #exist?, #getId, #get_property, #neo_id, #nodes, #other_node, #property?, #property_keys, #props, #rel_type, #remove_property, #set_property, #start_node, #update

Methods included from Wrapper::RelationshipMixin::Initialize

#_java_rel, #init_on_create, #init_on_load

Class Method Details

+ (Object) included(klass)



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/neo4j/relationship_mixin.rb', line 29

def self.included(klass)
  klass.extend Neo4j::Wrapper::ClassMethods
  klass.extend Neo4j::Wrapper::RelationshipMixin::ClassMethods
  klass.extend Neo4j::Wrapper::Property::ClassMethods
  klass.extend Neo4j::Core::Index::ClassMethods
  klass.extend Neo4j::Wrapper::Find
  klass.setup_rel_index

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

  super

end