Module: Arango::Database::EdgeCollections
- Included in:
- Arango::Database
- Defined in:
- lib/arango/database/edge_collections.rb
Instance Method Summary collapse
-
#all_edge_collections(exclude_system: true) ⇒ Array<Arango::EdgeCollection>
Retrieves all edge collections from the database.
-
#create_edge_collection(name:) ⇒ Arango::DocumentCollection
Creates a new edge collection.
-
#delete_edge_collection(name:) ⇒ Object
Removes a edge collection.
-
#edge_collection_exists?(name:, exclude_system: true) ⇒ Boolean
Check if edge collection exists.
-
#get_edge_collection(name:) ⇒ Arango::Database
(also: #fetch_edge_collection, #retrieve_edge_collection)
Get edge collection from the database.
-
#list_edge_collections(exclude_system: true) ⇒ Array<String>
Retrieves a list of edge collections.
-
#new_edge_collection(name:) ⇒ Arango::DocumentCollection
Instantiates a new edge collection.
Instance Method Details
#all_edge_collections(exclude_system: true) ⇒ Array<Arango::EdgeCollection>
Retrieves all edge collections from the database.
7 8 9 |
# File 'lib/arango/database/edge_collections.rb', line 7 def all_edge_collections(exclude_system: true) Arango::EdgeCollection::Base.all(exclude_system: exclude_system, database: self) end |
#create_edge_collection(name:) ⇒ Arango::DocumentCollection
Creates a new edge collection.
14 15 16 |
# File 'lib/arango/database/edge_collections.rb', line 14 def create_edge_collection(name:) Arango::EdgeCollection::Base.new(name: name, database: self).create end |
#delete_edge_collection(name:) ⇒ Object
Removes a edge collection.
44 45 46 |
# File 'lib/arango/database/edge_collections.rb', line 44 def delete_edge_collection(name:) Arango::EdgeCollection::Base.drop(name: name, database: self) end |
#edge_collection_exists?(name:, exclude_system: true) ⇒ Boolean
Check if edge collection exists.
51 52 53 |
# File 'lib/arango/database/edge_collections.rb', line 51 def edge_collection_exists?(name:, exclude_system: true) Arango::EdgeCollection::Base.exists?(name: name, database: self, exclude_system: exclude_system) end |
#get_edge_collection(name:) ⇒ Arango::Database Also known as: fetch_edge_collection, retrieve_edge_collection
Get edge collection from the database.
21 22 23 |
# File 'lib/arango/database/edge_collections.rb', line 21 def get_edge_collection(name:) Arango::EdgeCollection::Base.get(name: name, database: self) end |
#list_edge_collections(exclude_system: true) ⇒ Array<String>
Retrieves a list of edge collections.
37 38 39 |
# File 'lib/arango/database/edge_collections.rb', line 37 def list_edge_collections(exclude_system: true) Arango::EdgeCollection::Base.list(exclude_system: exclude_system, database: self) end |
#new_edge_collection(name:) ⇒ Arango::DocumentCollection
Instantiates a new edge collection.
30 31 32 |
# File 'lib/arango/database/edge_collections.rb', line 30 def new_edge_collection(name:) Arango::EdgeCollection::Base.new(name: name, type: :edge, database: self) end |