Class: Bugzilla::XMLRPC
- Inherits:
-
Object
- Object
- Bugzilla::XMLRPC
- Defined in:
- lib/bugzilla/xmlrpc.rb
Overview
Bugzilla::XMLRPC
Instance Method Summary collapse
-
#call(cmd, params = {}, user = nil, password = nil) ⇒ Object
Bugzilla::XMLRPC#call(cmd, params, user = nil, password = nil).
-
#cookie ⇒ Object
Bugzilla::XMLRPC#cookie.
-
#cookie=(val) ⇒ Object
Bugzilla::XMLRPC#cookie=(val).
-
#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) ⇒ XMLRPC
constructor
Bugzilla::XMLRPC#new(host, port = 443, path = ‘/xmlrpc.cgi’, proxy_host = nil, proxy_port = nil).
-
#token ⇒ Object
Bugzilla::XMLRPC#token.
-
#token=(val) ⇒ Object
Bugzilla::XMLRPC#token=(val).
Constructor Details
#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) ⇒ XMLRPC
Bugzilla::XMLRPC#new(host, port = 443, path = ‘/xmlrpc.cgi’, proxy_host = nil, proxy_port = nil)
38 39 40 41 42 43 44 45 |
# 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 |
Instance Method Details
#call(cmd, params = {}, user = nil, password = nil) ⇒ Object
Bugzilla::XMLRPC#call(cmd, params, user = nil, password = nil)
53 54 55 56 57 58 59 |
# 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 |
#cookie ⇒ Object
Bugzilla::XMLRPC#cookie
67 68 69 |
# File 'lib/bugzilla/xmlrpc.rb', line 67 def @xmlrpc. end |
#cookie=(val) ⇒ Object
Bugzilla::XMLRPC#cookie=(val)
77 78 79 |
# File 'lib/bugzilla/xmlrpc.rb', line 77 def (val) @xmlrpc. = val end |
#token ⇒ Object
Bugzilla::XMLRPC#token
87 88 89 |
# File 'lib/bugzilla/xmlrpc.rb', line 87 def token @token end |
#token=(val) ⇒ Object
Bugzilla::XMLRPC#token=(val)
97 98 99 |
# File 'lib/bugzilla/xmlrpc.rb', line 97 def token=(val) @token = val end |