Top Level Namespace

Defined Under Namespace

Modules: Arango

Instance Method Summary collapse

Instance Method Details

#add_vertex_collection(collection:) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/arango/graph/vertex_collections.rb', line 13

def add_vertex_collection(collection:)
  satisfy_module_or_string?(collection, Arango::DocumentCollection::Mixin)
  collection = collection.is_a?(String) ? collection : collection.name
  body = { collection: collection }
  result = request("POST", "vertex", body: body, key: :graph)
  return_element(result)
end

#remove_vertex_collection(collection:, dropCollection: nil) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/arango/graph/vertex_collections.rb', line 21

def remove_vertex_collection(collection:, dropCollection: nil)
  query = {dropCollection: dropCollection}
  satisfy_module_or_string?(collection, Arango::DocumentCollection)
  collection = collection.is_a?(String) ? collection : collection.name
  result = request("DELETE", "vertex/#{collection}", query: query, key: :graph)
  return_element(result)
end

#vertex_collectionObject



1
2
3
# File 'lib/arango/graph/vertex_collections.rb', line 1

def vertex_collection

end

#vertex_collectionsObject



5
6
7
8
9
10
11
# File 'lib/arango/graph/vertex_collections.rb', line 5

def vertex_collections
  result = request("GET", "vertex", key: :collections)
  return result if return_directly?(result)
  result.map do |x|
    Arango::DocumentCollection.new(name: x, database: @database, graph: self)
  end
end