Class: Rodzilla::Resource::Base

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/rodzilla/resource/base.rb

Direct Known Subclasses

Bug, Bugzilla, Classification, Product

Constant Summary collapse

@@_request_id =
1

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_url, username, password, format = :json) ⇒ Base

Returns a new instance of Base.



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/rodzilla/resource/base.rb', line 9

def initialize(base_url, username, password, format=:json)
  @base_url = base_url
  @username = username
  @password = password
  @format   = format
  @credentials = {
    : @username,
    Bugzilla_password: @password
  }
  @headers = { "Content-Type" => 'application/json-rpc' }
end

Instance Attribute Details

#base_urlObject

Returns the value of attribute base_url.



6
7
8
# File 'lib/rodzilla/resource/base.rb', line 6

def base_url
  @base_url
end

#credentialsObject

Returns the value of attribute credentials.



6
7
8
# File 'lib/rodzilla/resource/base.rb', line 6

def credentials
  @credentials
end

#formatObject

Returns the value of attribute format.



6
7
8
# File 'lib/rodzilla/resource/base.rb', line 6

def format
  @format
end

#headersObject

Returns the value of attribute headers.



6
7
8
# File 'lib/rodzilla/resource/base.rb', line 6

def headers
  @headers
end

#passwordObject

Returns the value of attribute password.



6
7
8
# File 'lib/rodzilla/resource/base.rb', line 6

def password
  @password
end

#request_urlObject

Returns the value of attribute request_url.



6
7
8
# File 'lib/rodzilla/resource/base.rb', line 6

def request_url
  @request_url
end

#responseObject

Returns the value of attribute response.



6
7
8
# File 'lib/rodzilla/resource/base.rb', line 6

def response
  @response
end

#resultObject

Returns the value of attribute result.



6
7
8
# File 'lib/rodzilla/resource/base.rb', line 6

def result
  @result
end

#usernameObject

Returns the value of attribute username.



6
7
8
# File 'lib/rodzilla/resource/base.rb', line 6

def username
  @username
end