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

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

Instance Attribute Summary

Attributes inherited from Connection

#conn_spec

Instance Method Summary collapse

Methods inherited from Connection

#close, #closed?, #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(plan, expr) ⇒ Object

Returns a cog for `expr` inside the compilation plan `plan`


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

def cog(plan, expr)
  name = expr.name
  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.


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

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