Class: Rodzilla::Resource::Base
- Inherits:
-
Object
- Object
- Rodzilla::Resource::Base
- Includes:
- HTTParty
- Defined in:
- lib/rodzilla/resource/base.rb
Direct Known Subclasses
Constant Summary collapse
- @@_request_id =
1
Instance Attribute Summary collapse
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#credentials ⇒ Object
Returns the value of attribute credentials.
-
#format ⇒ Object
Returns the value of attribute format.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#password ⇒ Object
Returns the value of attribute password.
-
#request_url ⇒ Object
Returns the value of attribute request_url.
-
#response ⇒ Object
Returns the value of attribute response.
-
#result ⇒ Object
Returns the value of attribute result.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(base_url, username, password, format = :json) ⇒ Base
constructor
A new instance of Base.
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 = { Bugzilla_login: @username, Bugzilla_password: @password } @headers = { "Content-Type" => 'application/json-rpc' } end |
Instance Attribute Details
#base_url ⇒ Object
Returns the value of attribute base_url.
6 7 8 |
# File 'lib/rodzilla/resource/base.rb', line 6 def base_url @base_url end |
#credentials ⇒ Object
Returns the value of attribute credentials.
6 7 8 |
# File 'lib/rodzilla/resource/base.rb', line 6 def credentials @credentials end |
#format ⇒ Object
Returns the value of attribute format.
6 7 8 |
# File 'lib/rodzilla/resource/base.rb', line 6 def format @format end |
#headers ⇒ Object
Returns the value of attribute headers.
6 7 8 |
# File 'lib/rodzilla/resource/base.rb', line 6 def headers @headers end |
#password ⇒ Object
Returns the value of attribute password.
6 7 8 |
# File 'lib/rodzilla/resource/base.rb', line 6 def password @password end |
#request_url ⇒ Object
Returns the value of attribute request_url.
6 7 8 |
# File 'lib/rodzilla/resource/base.rb', line 6 def request_url @request_url end |
#response ⇒ Object
Returns the value of attribute response.
6 7 8 |
# File 'lib/rodzilla/resource/base.rb', line 6 def response @response end |
#result ⇒ Object
Returns the value of attribute result.
6 7 8 |
# File 'lib/rodzilla/resource/base.rb', line 6 def result @result end |
#username ⇒ Object
Returns the value of attribute username.
6 7 8 |
# File 'lib/rodzilla/resource/base.rb', line 6 def username @username end |