class Bugzilla::XMLRPC

Bugzilla::XMLRPC

Public Class Methods

new(host, port = 443, path = '/xmlrpc.cgi', proxy_host = nil, proxy_port = nil, timeout = 60, http_basic_auth_user = nil, http_basic_auth_pass = nil) click to toggle source

Bugzilla::XMLRPC#new(host, port = 443, path = '/xmlrpc.cgi', proxy_host = nil, proxy_port = nil)

# File lib/bugzilla/xmlrpc.rb, line 38
def initialize(host, port = 443, path = '/xmlrpc.cgi', proxy_host = nil, proxy_port = nil, timeout = 60, http_basic_auth_user = nil, http_basic_auth_pass = nil)
  path ||= '/xmlrpc.cgi'
  use_ssl = port == 443 ? true : false
  @xmlrpc = ::XMLRPC::Client.new(host, path, port, proxy_host, proxy_port, http_basic_auth_user, http_basic_auth_pass, use_ssl, timeout)

  # workaround for https://bugs.ruby-lang.org/issues/8182
  @xmlrpc.http_header_extra = {'accept-encoding' => 'identity'}
end

Public Instance Methods

call(cmd, params = {}, user = nil, password = nil) click to toggle source

Bugzilla::XMLRPC#call(cmd, params, user = nil, password = nil)

# File lib/bugzilla/xmlrpc.rb, line 53
def call(cmd, params = {}, user = nil, password = nil)
  params = {} if params.nil?
  params['Bugzilla_login'] = user unless user.nil? || password.nil?
  params['Bugzilla_password'] = password unless user.nil? || password.nil?
  params['Bugzilla_token'] = @token unless @token.nil?
  @xmlrpc.call(cmd, params)
end
token() click to toggle source

Bugzilla::XMLRPC#token

# File lib/bugzilla/xmlrpc.rb, line 87
def token
  @token
end
token=(val) click to toggle source

Bugzilla::XMLRPC#token=(val)

# File lib/bugzilla/xmlrpc.rb, line 97
def token=(val)
  @token = val
end