Class: QuartzTorrent::FileRegion

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

Overview

Represents a unique region of a file: a filename, offset, and length.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path = nil, offset = nil, length = nil) ⇒ FileRegion

Returns a new instance of FileRegion.



33
34
35
36
37
# File 'lib/quartz_torrent/filemanager.rb', line 33

def initialize(path = nil, offset = nil, length = nil)
  @path = path
  @offset = offset
  @length = length
end

Instance Attribute Details

#lengthObject

Returns the value of attribute length.



41
42
43
# File 'lib/quartz_torrent/filemanager.rb', line 41

def length
  @length
end

#offsetObject

Returns the value of attribute offset.



40
41
42
# File 'lib/quartz_torrent/filemanager.rb', line 40

def offset
  @offset
end

#pathObject

Returns the value of attribute path.



39
40
41
# File 'lib/quartz_torrent/filemanager.rb', line 39

def path
  @path
end