Sha256: ab5f6dd3491a1360282f01eae0c4f1caa73c4dee4325b0d01645feac43e955ff

Contents?: true

Size: 450 Bytes

Versions: 1

Compression:

Stored size: 450 Bytes

Contents

class Sabnzbd
  class Utils
    attr_accessor :sabnzbd

    def initialize (parent)
      @sabnzbd = parent
    end

    def slot_positions
      return_hash = {}
      sabnzbd.slots(true).each do |s|
        return_hash[s.position] = s.nzo_id
      end

      return_hash
    end

    def switch(slot_a, slot_b)
      sabnzbd.make_request("/api?mode=switch&value=#{slot_a.nzo_id}&value2=#{slot_b.nzo_id}&apikey=#{sabnzbd.api_key}")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sabnzbd-0.2.0 lib/sabnzbd/utils.rb