Class: Net::SFTP::Packet
- Inherits:
-
Net::SSH::Buffer
- Object
- Net::SSH::Buffer
- Net::SFTP::Packet
- Defined in:
- lib/net/sftp/packet.rb
Overview
A specialization of the Net::SSH::Buffer class, which simply auto-reads the type byte from the front of every packet it represents.
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
The (intger) type of this packet.
Instance Method Summary collapse
-
#initialize(data) ⇒ Packet
constructor
Create a new Packet object that wraps the given
data
(which should be a String).
Constructor Details
#initialize(data) ⇒ Packet
Create a new Packet object that wraps the given data
(which should be a String). The first byte of the data will be consumed automatically and interpreted as the #type of this packet.
15 16 17 18 |
# File 'lib/net/sftp/packet.rb', line 15 def initialize(data) super @type = read_byte end |
Instance Attribute Details
#type ⇒ Object (readonly)
The (intger) type of this packet. See Net::SFTP::Constants for all possible packet types.
10 11 12 |
# File 'lib/net/sftp/packet.rb', line 10 def type @type end |