Class: Axiom::Adapter::Arango::Adapter

Inherits:
Object
  • Object
show all
Includes:
Adamantium::Flat
Defined in:
lib/axiom/adapter/arango/adapter.rb

Overview

Adapter to read tuples from remote ArangoDB

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#databaseArangoDB::Database (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return database

Returns:

  • (ArangoDB::Database)


23
24
25
# File 'lib/axiom/adapter/arango/adapter.rb', line 23

def database
  @database
end

#loggerLogger (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return logger

Returns:

  • (Logger)


15
16
17
# File 'lib/axiom/adapter/arango/adapter.rb', line 15

def logger
  @logger
end

Class Method Details

.new(_database, _logger = NullLogger.instance) ⇒ undefined

Return new adapter

Examples:


database = Ashikawa::Core::Database.new('http://localhost:8529')
adapter = Axiom::Adapter::Arango::Adapter.new(database, Logger.new($stderr, :debug))

Parameters:

  • _database (Ashikawa::Core::Database)
  • _logger (NullLogger) (defaults to: NullLogger.instance)

Returns:

  • (undefined)


39
40
41
# File 'lib/axiom/adapter/arango/adapter.rb', line 39

def self.new(_database, _logger = NullLogger.instance)
  super
end

Instance Method Details

#gateway(base_relation) ⇒ Gateway

Return gateway for the ArangoDB adapter

Examples:


gateway = adapter.gateway(base_relation)

# Perform restriction on gateway
relation = gateway.restrict { |r| r.foo.eql('bar') }

# Enumerate tuples
relation.each do |tuple|
  p tuple.to_ary
end

Parameters:

  • base_relation (Relation::Base)

Returns:



77
78
79
# File 'lib/axiom/adapter/arango/adapter.rb', line 77

def gateway(base_relation)
  Gateway.new(self, base_relation)
end

#reader(base_relation) ⇒ Reader

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return reader for base relation

Parameters:

  • base_relation (Relation::Base)

    the relation to read from

Returns:



53
54
55
# File 'lib/axiom/adapter/arango/adapter.rb', line 53

def reader(base_relation)
  Reader.new(self, base_relation)
end