Class: QuartzTorrent::PieceManager::Result

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

Overview

The result of an asynchronous operation preformed by the PieceManager.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(requestId, success, data, error = nil) ⇒ Result

Returns a new instance of Result.



261
262
263
264
265
266
# File 'lib/quartz_torrent/filemanager.rb', line 261

def initialize(requestId, success, data, error = nil)
  @success = success
  @error = error
  @data = data
  @requestId = requestId
end

Instance Attribute Details

#dataObject

Any data returned in the result



276
277
278
# File 'lib/quartz_torrent/filemanager.rb', line 276

def data
  @data
end

#errorObject

The error message if the operation was not successful



273
274
275
# File 'lib/quartz_torrent/filemanager.rb', line 273

def error
  @error
end

#requestIdObject

The ID of the request that this result is for. This is the same as the id returned when making the request.



270
271
272
# File 'lib/quartz_torrent/filemanager.rb', line 270

def requestId
  @requestId
end

Instance Method Details

#successful?Boolean

Returns true if the operation was succesful

Returns:

  • (Boolean)


279
280
281
# File 'lib/quartz_torrent/filemanager.rb', line 279

def successful?
  @success
end