Class: HrrRbSftp::Receiver
- Inherits:
-
Object
- Object
- HrrRbSftp::Receiver
- Defined in:
- lib/hrr_rb_sftp/receiver.rb
Instance Method Summary collapse
-
#initialize(io_in) ⇒ Receiver
constructor
A new instance of Receiver.
- #receive ⇒ Object
Constructor Details
#initialize(io_in) ⇒ Receiver
Returns a new instance of Receiver.
3 4 5 |
# File 'lib/hrr_rb_sftp/receiver.rb', line 3 def initialize io_in @io_in = io_in end |
Instance Method Details
#receive ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/hrr_rb_sftp/receiver.rb', line 7 def receive begin paylaod_length = Protocol::Common::DataType::Uint32.decode(@io_in) rescue NoMethodError nil else payload = @io_in.read(paylaod_length) if payload.nil? || payload.length != paylaod_length nil else payload end end end |