Class: Aniview::Interface::TorrentItem

Inherits:
Item
  • Object
show all
Includes:
Util
Defined in:
lib/aniview/interface/deluge/torrentitem.rb

Instance Attribute Summary

Attributes inherited from Item

#attr

Instance Method Summary collapse

Methods included from Util

decode_object, encode_object, error_message, format_duration, format_progress, format_size, mounted_filesystem?, parse_format, readline

Methods inherited from Item

#cereal

Constructor Details

#initialize(name:, progress:, eta:, paused:, state:, id:) ⇒ TorrentItem

Returns a new instance of TorrentItem.



8
9
10
11
12
13
14
15
16
17
# File 'lib/aniview/interface/deluge/torrentitem.rb', line 8

def initialize(name:, progress:, eta:, paused:, state:, id:)
	@attr = {
		"n" => name,
		"p" => Util.format_progress(progress),
		"e" => Util.format_duration(eta),
     "u" => paused,
     "s" => state,
     "h" => id
	}
end

Instance Method Details

#attributesObject



19
20
21
# File 'lib/aniview/interface/deluge/torrentitem.rb', line 19

def attributes
	return @attr
end