Sha256: 05f3aee7ed3b2f90c7987afac50d4235717b32e192629586236b5c29b88e0b0e

Contents?: true

Size: 682 Bytes

Versions: 6

Compression:

Stored size: 682 Bytes

Contents

module Alf
  class Adapter
    class Folder < Adapter

      # (see Connection.recognizes?)
      #
      # @return [Boolean] true if args contains one String only, which denotes
      #         an existing folder; false otherwise
      def self.recognizes?(conn_spec)
        Path.like?(conn_spec) && Path(conn_spec).directory?
      end

      # Returns a connection on the underlying folder
      def connection
        Folder::Connection.new(Path(conn_spec))
      end

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

      Adapter.register(:folder, self)
    end # class Folder
  end # class Adapter
end # module Alf
require_relative 'folder/connection'

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
alf-core-0.16.3 lib/alf/adapter/folder.rb
alf-core-0.16.2 lib/alf/adapter/folder.rb
alf-core-0.16.1 lib/alf/adapter/folder.rb
alf-core-0.16.0 lib/alf/adapter/folder.rb
alf-core-0.15.0 lib/alf/adapter/folder.rb
alf-core-0.14.0 lib/alf-adapter-fs/alf/adapter/folder.rb