Class: SabnzbdPlusModel::QueueSlot

Inherits:
Slot show all
Defined in:
lib/sabnzbd_plus/model/queue_slot.rb

Overview

A single queue slot item returned by SAB

Instance Attribute Summary (collapse)

Attributes inherited from Slot

#nzo_id, #script, #size, #status

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from Slot

factory, from_hash, #initialize

Methods inherited from Response

#eql?, from_hash

Constructor Details

This class inherits a constructor from SabnzbdPlusModel::Slot

Instance Attribute Details

- (String) avg_age

Returns:

  • (String)


19
20
21
# File 'lib/sabnzbd_plus/model/queue_slot.rb', line 19

def avg_age
  @avg_age
end

- (String) cat

Returns:

  • (String)


37
38
39
# File 'lib/sabnzbd_plus/model/queue_slot.rb', line 37

def cat
  @cat
end

- (String) eta

Returns:

  • (String)


13
14
15
# File 'lib/sabnzbd_plus/model/queue_slot.rb', line 13

def eta
  @eta
end

- (String) filename

Returns:

  • (String)


31
32
33
# File 'lib/sabnzbd_plus/model/queue_slot.rb', line 31

def filename
  @filename
end

- (String) index

Returns:

  • (String)


10
11
12
# File 'lib/sabnzbd_plus/model/queue_slot.rb', line 10

def index
  @index
end

- (String) mb

Returns:

  • (String)


28
29
30
# File 'lib/sabnzbd_plus/model/queue_slot.rb', line 28

def mb
  @mb
end

- (String) mb_left

Returns:

  • (String)


40
41
42
# File 'lib/sabnzbd_plus/model/queue_slot.rb', line 40

def mb_left
  @mb_left
end

- (String) msg_id

Returns:

  • (String)


22
23
24
# File 'lib/sabnzbd_plus/model/queue_slot.rb', line 22

def msg_id
  @msg_id
end

- (String) percentage

Returns:

  • (String)


43
44
45
# File 'lib/sabnzbd_plus/model/queue_slot.rb', line 43

def percentage
  @percentage
end

- (String) priority

Returns:

  • (String)


34
35
36
# File 'lib/sabnzbd_plus/model/queue_slot.rb', line 34

def priority
  @priority
end

- (String) size_left

Returns:

  • (String)


49
50
51
# File 'lib/sabnzbd_plus/model/queue_slot.rb', line 49

def size_left
  @size_left
end

- (String) time_left

Returns:

  • (String)


16
17
18
# File 'lib/sabnzbd_plus/model/queue_slot.rb', line 16

def time_left
  @time_left
end

- (String) unpack_opts

Returns:

  • (String)


46
47
48
# File 'lib/sabnzbd_plus/model/queue_slot.rb', line 46

def unpack_opts
  @unpack_opts
end

- (String) verbosity

Returns:

  • (String)


25
26
27
# File 'lib/sabnzbd_plus/model/queue_slot.rb', line 25

def verbosity
  @verbosity
end

Class Method Details

+ (Hash<String, Label>) parameter_mapping

Get the parameter mapping that maps the SABnzbd+ API parameter names to their Rubyish equivalent

Returns:

  • (Hash<String, Label>)


55
56
57
58
59
60
61
62
63
# File 'lib/sabnzbd_plus/model/queue_slot.rb', line 55

def self.parameter_mapping
  return super.merge({
      "msgid" => :msg_id,
      "mbleft" => :mb_left,
      "unpackopts" => :unpack_opts,
      "sizeleft" => :size_left,
      "timeleft" => :time_left
    })
end

Instance Method Details

- (Boolean) ==(item)

Compare this object with another queue object comparing only the values in it's attributes.

Parameters:

Returns:

  • (Boolean)

See Also:



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/sabnzbd_plus/model/queue_slot.rb', line 87

def ==(item)
  unless(
    item.index       == self.index &&
    item.eta         == self.eta &&
    item.time_left   == self.time_left &&
    item.avg_age     == self.avg_age &&
    item.msg_id      == self.msg_id &&
    item.verbosity   == self.verbosity &&
    item.mb          == self.mb &&
    item.filename    == self.filename &&
    item.priority    == self.priority &&
    item.cat         == self.cat &&
    item.mb_left     == self.mb_left &&
    item.percentage  == self.percentage &&
    item.unpack_opts == self.unpack_opts)

    return false
  end

  return super item
end

- (String) name

Maps filename onto Name, so history and queue have a common name.

Returns:

  • (String)

See Also:



69
70
71
# File 'lib/sabnzbd_plus/model/queue_slot.rb', line 69

def name
  return self.filename
end

- (Object) name=(name)

Maps filename onto Name, so history and queue have a common name.

Parameters:

  • name (String)

See Also:



77
78
79
# File 'lib/sabnzbd_plus/model/queue_slot.rb', line 77

def name=(name)
  self.filename = name
end