Class: QBittorrent::Api

Inherits:
Object
  • Object
show all
Includes:
WebApi::App, WebApi::Authroize, WebApi::Core, WebApi::Torrent
Defined in:
lib/qbittorrent/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from WebApi::Torrent

#add_torrents, #delete_torrents, #get_torrents, #reannounce

Methods included from WebApi::App

#api_version, #application_version, #build_info, #default_save_path, #preferences, #set_preferences, #shutdown

Methods included from WebApi::Authroize

#login, #logout

Constructor Details

#initialize(host, username, password, logger = nil, **global_options) ⇒ Api

Returns a new instance of Api.



18
19
20
21
22
23
24
# File 'lib/qbittorrent/api.rb', line 18

def initialize(host, username, password, logger = nil, **global_options)
  @host = host.delete_suffix('/')
  @username = username
  @password = password
  @logger = logger ? Logger.new(logger) : nil
  @global_options = global_options
end

Instance Attribute Details

#cookiesObject

Returns the value of attribute cookies.



16
17
18
# File 'lib/qbittorrent/api.rb', line 16

def cookies
  @cookies
end

#global_optionsObject

Returns the value of attribute global_options.



16
17
18
# File 'lib/qbittorrent/api.rb', line 16

def global_options
  @global_options
end

#hostObject

Returns the value of attribute host.



16
17
18
# File 'lib/qbittorrent/api.rb', line 16

def host
  @host
end

#loggerObject

Returns the value of attribute logger.



16
17
18
# File 'lib/qbittorrent/api.rb', line 16

def logger
  @logger
end

#passwordObject

Returns the value of attribute password.



16
17
18
# File 'lib/qbittorrent/api.rb', line 16

def password
  @password
end

#usernameObject

Returns the value of attribute username.



16
17
18
# File 'lib/qbittorrent/api.rb', line 16

def username
  @username
end