Class: HrrRbSftp::Sender

Inherits:
Object
  • Object
show all
Defined in:
lib/hrr_rb_sftp/sender.rb

Instance Method Summary collapse

Constructor Details

#initialize(io_out) ⇒ Sender

Returns a new instance of Sender.



3
4
5
# File 'lib/hrr_rb_sftp/sender.rb', line 3

def initialize io_out
  @io_out = io_out
end

Instance Method Details

#send(payload) ⇒ Object



7
8
9
10
11
# File 'lib/hrr_rb_sftp/sender.rb', line 7

def send payload
  @io_out.write(Protocol::Common::DataType::Uint32.encode(payload.length))
  @io_out.write(payload)
  @io_out.flush
end