Module: Neography::Index

Included in:
Node, Relationship
Defined in:
lib/neography/index.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object


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

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#add_to_index(index, key, value, unique = false) ⇒ Object


8
9
10
11
12
13
14
# File 'lib/neography/index.rb', line 8

def add_to_index(index, key, value, unique = false)
  if self.is_a? Neography::Node
    self.neo_server.add_node_to_index(index, key, value, self.neo_id, unique)
  else
    self.neo_server.add_relationship_to_index(index, key, value, self.neo_id)
  end
end

#remove_from_index(*args) ⇒ Object


16
17
18
19
20
21
22
# File 'lib/neography/index.rb', line 16

def remove_from_index(*args)
  if self.is_a? Neography::Node
    self.neo_server.remove_node_from_index(*args)
  else
    self.neo_server.remove_relationship_from_index(*args)
  end
end