Class: Neo4jr::RelationshipType

Inherits:
Object
  • Object
show all
Defined in:
lib/neo4jr/relationship_type.rb

Constant Summary collapse

@@names =
{}

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.both(type) ⇒ Object



25
26
27
# File 'lib/neo4jr/relationship_type.rb', line 25

def both(type)
  covert_to_relationship_type(Neo4jr::Direction::BOTH, type)
end

.incoming(type) ⇒ Object



21
22
23
# File 'lib/neo4jr/relationship_type.rb', line 21

def incoming(type)
  covert_to_relationship_type(Neo4jr::Direction::INCOMING, type)
end

.instance(name) ⇒ Object



8
9
10
11
# File 'lib/neo4jr/relationship_type.rb', line 8

def instance(name)
  return @@names[name] if @@names.include?(name)
  @@names[name] = RelationshipType.new(name)
end

.instances(*names) ⇒ Object



13
14
15
# File 'lib/neo4jr/relationship_type.rb', line 13

def instances(*names)
  names.map{|name| instance(name)}.to_java(org.neo4j.graphdb.RelationshipType)
end

.outgoing(type) ⇒ Object



17
18
19
# File 'lib/neo4jr/relationship_type.rb', line 17

def outgoing(type)
  covert_to_relationship_type(Neo4jr::Direction::OUTGOING, type)
end

Instance Method Details

#nameObject



45
46
47
# File 'lib/neo4jr/relationship_type.rb', line 45

def name
  @name
end

#to_aObject



41
42
43
# File 'lib/neo4jr/relationship_type.rb', line 41

def to_a
  [self].to_java(org.neo4j.graphdb.RelationshipType)
end

#to_sObject



37
38
39
# File 'lib/neo4jr/relationship_type.rb', line 37

def to_s
  self.class.to_s + " name='#{@name}'"
end