Module: Neography::NodeRelationship

Included in:
Node
Defined in:
lib/neography/node_relationship.rb

Instance Method Summary collapse

Instance Method Details

#both(types = nil) ⇒ Object



12
13
14
# File 'lib/neography/node_relationship.rb', line 12

def both(types=nil)
  NodeTraverser.new(self).both(types)
end

#incoming(types = nil) ⇒ Object



8
9
10
# File 'lib/neography/node_relationship.rb', line 8

def incoming(types=nil)
  NodeTraverser.new(self).incoming(types)
end

#outgoing(types = nil) ⇒ Object



4
5
6
# File 'lib/neography/node_relationship.rb', line 4

def outgoing(types=nil)
  NodeTraverser.new(self).outgoing(types)
end

#rel(dir, type) ⇒ Object



20
21
22
23
24
# File 'lib/neography/node_relationship.rb', line 20

def rel(dir, type)
  rel = Neography::RelationshipTraverser.new(self, type, dir)
  rel = rel.first unless rel.nil?
  rel
end

#rel?(dir = nil, type = nil) ⇒ Boolean

Returns:

  • (Boolean)


26
27
28
29
30
31
32
# File 'lib/neography/node_relationship.rb', line 26

def rel?(dir=nil, type=nil)
  if DIRECTIONS.include?(dir.to_s)
    !self.neo_server.get_node_relationships(self, dir, type).nil? 
  else
    !self.neo_server.get_node_relationships(self, type, dir).nil? 
  end
end

#rels(*types) ⇒ Object



16
17
18
# File 'lib/neography/node_relationship.rb', line 16

def rels(*types)
  Neography::RelationshipTraverser.new(self, types, :both)
end