Class: Alf::Adapter::Folder

Inherits:
Alf::Adapter show all
Defined in:
lib/alf/adapter/folder.rb,
lib/alf/adapter/folder/connection.rb

Defined Under Namespace

Classes: Connection

Instance Attribute Summary

Attributes inherited from Alf::Adapter

#conn_spec

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Alf::Adapter

autodetect, #connect, factor, #initialize, register

Methods included from Support::Registry

#each, #listen, #listeners, #register, #registered

Constructor Details

This class inherits a constructor from Alf::Adapter

Class Method Details

.recognizes?(conn_spec) ⇒ Boolean

Returns:

  • (Boolean)

    true if args contains one String only, which denotes an existing folder; false otherwise

  • (Boolean)

    true if args contains one String only, which denotes an existing folder; false otherwise


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

def self.recognizes?(conn_spec)
  Path.like?(conn_spec) && Path(conn_spec).directory?
end

Instance Method Details

#connectionObject

Returns a connection on the underlying folder


14
15
16
# File 'lib/alf/adapter/folder.rb', line 14

def connection
  Folder::Connection.new(Path(conn_spec))
end

#to_sObject


18
19
20
# File 'lib/alf/adapter/folder.rb', line 18

def to_s
  "Alf::Adapter::Folder(#{conn_spec})"
end