Class Net::SFTP::Protocol::PacketAssistant
In: lib/net/sftp/protocol/packet-assistant.rb
Parent: Object

This is the abstract base class for all packet assistant classes used by the supported SFTP protocol versions.

Methods

new   packet  

Attributes

buffers  [R]  The buffer factory in use by this packet assistant, used to build the packets.
driver  [R]  The protocol driver that will be used to obtain request ids.

Public Class methods

Create a new PacketAssistant, which will use the given buffer factory and SFTP protocol driver.

A helper method for defining a new packet type. The name is the name of the packet (and of the corresponding method that is created), and the arguments are symbols representing the types of each element in the packet. The supported types are:

  • :long
  • :int64
  • :short
  • :byte
  • :string
  • :attrs
  • :write

The :attrs and :write types both simply convert the argument to a string.

The method that is created always supports an id parameter in the first position, which if null will default to the next available request id. The method returns a tuple consisting of the request id, and a string consisting of the arguments formatted according to the packet‘s description.

[Validate]