Class: TFTP::ClientDownloader
- Inherits:
-
Object
- Object
- TFTP::ClientDownloader
- Defined in:
- lib/em-tftp.rb
Instance Method Summary collapse
- #completed ⇒ Object
- #failed(error_msg) ⇒ Object
-
#initialize(&block) ⇒ ClientDownloader
constructor
A new instance of ClientDownloader.
- #received_block(block) ⇒ Object
Constructor Details
#initialize(&block) ⇒ ClientDownloader
Returns a new instance of ClientDownloader.
380 381 382 383 |
# File 'lib/em-tftp.rb', line 380 def initialize(&block) @callback = block @buffer = "" end |
Instance Method Details
#completed ⇒ Object
387 388 389 |
# File 'lib/em-tftp.rb', line 387 def completed @callback.call(true, @buffer) end |
#failed(error_msg) ⇒ Object
390 391 392 |
# File 'lib/em-tftp.rb', line 390 def failed(error_msg) @callback.call(false, error_msg) end |
#received_block(block) ⇒ Object
384 385 386 |
# File 'lib/em-tftp.rb', line 384 def received_block(block) @buffer << block end |