Class: QuartzTorrent::WriteOnlyIoFacade

Inherits:
IoFacade
  • Object
show all
Defined in:
lib/quartz_torrent/reactor.rb

Overview

An IoFacade that doesn’t allow reading. This is not part of the public API.

Instance Attribute Summary

Attributes inherited from IoFacade

#logger

Instance Method Summary collapse

Methods inherited from IoFacade

#close, #closed?, #flush, #readRateLimit=, #removeFromIOHash, #seek, #write, #writeRateLimit=

Constructor Details

#initialize(ioInfo, logger = nil, readError = "Reading is not allowed for this IO") ⇒ WriteOnlyIoFacade

Create a new WriteOnlyIoFacade that delegates to the passed IOInfo object.



319
320
321
322
# File 'lib/quartz_torrent/reactor.rb', line 319

def initialize(ioInfo, logger = nil, readError = "Reading is not allowed for this IO")
  super(ioInfo, logger)
  @readError = readError
end

Instance Method Details

#read(length) ⇒ Object

Raise an exception.

Raises:

  • (@readError)


325
326
327
# File 'lib/quartz_torrent/reactor.rb', line 325

def read(length)
  raise @readError
end