Module: Net::SFTP::Protocol

Defined in:
lib/net/sftp/protocol.rb,
lib/net/sftp/protocol/base.rb,
lib/net/sftp/protocol/01/base.rb,
lib/net/sftp/protocol/01/name.rb,
lib/net/sftp/protocol/02/base.rb,
lib/net/sftp/protocol/03/base.rb,
lib/net/sftp/protocol/04/base.rb,
lib/net/sftp/protocol/04/name.rb,
lib/net/sftp/protocol/05/base.rb,
lib/net/sftp/protocol/06/base.rb,
lib/net/sftp/protocol/01/attributes.rb,
lib/net/sftp/protocol/04/attributes.rb,
lib/net/sftp/protocol/06/attributes.rb

Overview

The Protocol module contains the definitions for all supported SFTP protocol versions.

Defined Under Namespace

Modules: V01, V02, V03, V04, V05, V06 Classes: Base

Class Method Summary collapse

Class Method Details

.load(session, version) ⇒ Object

Instantiates and returns a new protocol driver instance for the given protocol version. session must be a valid SFTP session object, and version must be an integer. If an unsupported version is given, an exception will be raised.



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/net/sftp/protocol.rb', line 18

def self.load(session, version)
  case version
  when 1 then V01::Base.new(session)
  when 2 then V02::Base.new(session)
  when 3 then V03::Base.new(session)
  when 4 then V04::Base.new(session)
  when 5 then V05::Base.new(session)
  when 6 then V06::Base.new(session)
  else raise NotImplementedError, "unsupported SFTP version #{version.inspect}"
  end
end