Class: Alf::Adapter::Folder::Connection

Inherits:
Connection
  • Object
show all
Defined in:
lib/alf-adapter-fs/alf/adapter/folder/connection.rb

Instance Attribute Summary

Attributes inherited from Connection

#conn_spec

Instance Method Summary collapse

Methods inherited from Connection

#close, #closed?, #compiler, #delete, #heading, #in_transaction, #initialize, #insert, #keys, #lock, #migrate!, #update

Constructor Details

This class inherits a constructor from Alf::Adapter::Connection

Instance Method Details

#cog(name, expr = nil) ⇒ Object

Returns a cog for ‘name`



14
15
16
17
18
19
20
21
# File 'lib/alf-adapter-fs/alf/adapter/folder/connection.rb', line 14

def cog(name, expr = nil)
  if f = find_file(name)
    reader = Reader.reader(find_file(name))
    Alf::Engine::Leaf.new(reader, expr)
  else
    raise NoSuchRelvarError, "Unable to find a file for #{name}"
  end
end

#knows?(name) ⇒ Boolean

Returns true if ‘name` is known, false otherwise.

Returns:

  • (Boolean)


9
10
11
# File 'lib/alf-adapter-fs/alf/adapter/folder/connection.rb', line 9

def knows?(name)
  !find_file(name).nil?
end