Class: RUTorrent::JobProperties
- Inherits:
-
Object
- Object
- RUTorrent::JobProperties
- Defined in:
- lib/rutorrent/job_properties.rb
Instance Attribute Summary (collapse)
-
- (Object) dht
readonly
Returns the value of attribute dht.
-
- (Object) dlrate
readonly
Returns the value of attribute dlrate.
-
- (Object) hash
readonly
Returns the value of attribute hash.
-
- (Object) pex
readonly
Returns the value of attribute pex.
-
- (Object) seed_override
readonly
Returns the value of attribute seed_override.
-
- (Object) seed_ratio
readonly
Returns the value of attribute seed_ratio.
-
- (Object) seed_time
readonly
Returns the value of attribute seed_time.
-
- (Object) superseed
readonly
Returns the value of attribute superseed.
-
- (Object) trackers
readonly
Returns the value of attribute trackers.
-
- (Object) ulrate
readonly
Returns the value of attribute ulrate.
-
- (Object) ulslots
readonly
Returns the value of attribute ulslots.
Instance Method Summary (collapse)
- - (Boolean) dht?
-
- (JobProperties) initialize(hash)
constructor
A new instance of JobProperties.
- - (Boolean) pex?
- - (Boolean) seed_override?
- - (Boolean) superseed?
Constructor Details
- (JobProperties) initialize(hash)
A new instance of JobProperties
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/rutorrent/job_properties.rb', line 6 def initialize(hash) @hash = hash['hash'] @trackers = hash['trackers'] @ulrate = hash['ulrate'] @dlrate = hash['dlrate'] @superseed = hash['superseed'] @dht = hash['dht'] @pex = hash['pex'] @seed_override = hash['seed_override'] @seed_ratio = hash['seed_ratio'] @seed_time = hash['seed_time'] @ulslots = hash['ulslots'] end |
Instance Attribute Details
- (Object) dht (readonly)
Returns the value of attribute dht
3 4 5 |
# File 'lib/rutorrent/job_properties.rb', line 3 def dht @dht end |
- (Object) dlrate (readonly)
Returns the value of attribute dlrate
3 4 5 |
# File 'lib/rutorrent/job_properties.rb', line 3 def dlrate @dlrate end |
- (Object) hash (readonly)
Returns the value of attribute hash
3 4 5 |
# File 'lib/rutorrent/job_properties.rb', line 3 def hash @hash end |
- (Object) pex (readonly)
Returns the value of attribute pex
3 4 5 |
# File 'lib/rutorrent/job_properties.rb', line 3 def pex @pex end |
- (Object) seed_override (readonly)
Returns the value of attribute seed_override
3 4 5 |
# File 'lib/rutorrent/job_properties.rb', line 3 def seed_override @seed_override end |
- (Object) seed_ratio (readonly)
Returns the value of attribute seed_ratio
3 4 5 |
# File 'lib/rutorrent/job_properties.rb', line 3 def seed_ratio @seed_ratio / 1000.0 end |
- (Object) seed_time (readonly)
Returns the value of attribute seed_time
3 4 5 |
# File 'lib/rutorrent/job_properties.rb', line 3 def seed_time @seed_time end |
- (Object) superseed (readonly)
Returns the value of attribute superseed
3 4 5 |
# File 'lib/rutorrent/job_properties.rb', line 3 def superseed @superseed end |
- (Object) trackers (readonly)
Returns the value of attribute trackers
3 4 5 |
# File 'lib/rutorrent/job_properties.rb', line 3 def trackers @trackers.split("\r\n") end |
- (Object) ulrate (readonly)
Returns the value of attribute ulrate
3 4 5 |
# File 'lib/rutorrent/job_properties.rb', line 3 def ulrate @ulrate end |
- (Object) ulslots (readonly)
Returns the value of attribute ulslots
3 4 5 |
# File 'lib/rutorrent/job_properties.rb', line 3 def ulslots @ulslots end |
Instance Method Details
- (Boolean) dht?
24 25 26 |
# File 'lib/rutorrent/job_properties.rb', line 24 def dht? @dht == 1 end |
- (Boolean) pex?
28 29 30 |
# File 'lib/rutorrent/job_properties.rb', line 28 def pex? @pex == 1 end |
- (Boolean) seed_override?
32 33 34 |
# File 'lib/rutorrent/job_properties.rb', line 32 def seed_override? @seed_override == 1 end |
- (Boolean) superseed?
20 21 22 |
# File 'lib/rutorrent/job_properties.rb', line 20 def superseed? @superseed == 1 end |