Class: Canery::Backend

Inherits:
Object
  • Object
show all
Defined in:
lib/canery/backend.rb

Constant Summary collapse

TABLE_PREFIX =
"canery_"

Instance Method Summary collapse

Constructor Details

#initialize(connection_uri) ⇒ Backend

Returns a new instance of Backend.

Raises:

  • (ArgumentError)


12
13
14
15
16
17
# File 'lib/canery/backend.rb', line 12

def initialize(connection_uri)
  raise ArgumentError, "connection_uri must be a String or nil" unless NilClass === connection_uri || String === connection_uri
  
  @connection = connection_uri.nil? ? Sequel.sqlite : Sequel.connect(connection_uri)
  @namespace_cache = {}
end

Instance Method Details

#call(command, *args) ⇒ Object

Only expose call method



20
21
22
# File 'lib/canery/backend.rb', line 20

def call(command, *args)
  self.send(command, *args)
end