Class: Gerrit
- Inherits:
-
Struct
- Object
- Struct
- Gerrit
- Defined in:
- lib/gerrit.rb
Defined Under Namespace
Classes: Change
Instance Attribute Summary collapse
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#password ⇒ Object
Returns the value of attribute password.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
- #change(change_id) ⇒ Object
- #get(endpoint) ⇒ Object
- #post(endpoint, body = '') ⇒ Object
- #put(endpoint, body = {}) ⇒ Object
Instance Attribute Details
#base_url ⇒ Object
Returns the value of attribute base_url
5 6 7 |
# File 'lib/gerrit.rb', line 5 def base_url @base_url end |
#password ⇒ Object
Returns the value of attribute password
5 6 7 |
# File 'lib/gerrit.rb', line 5 def password @password end |
#username ⇒ Object
Returns the value of attribute username
5 6 7 |
# File 'lib/gerrit.rb', line 5 def username @username end |
Instance Method Details
#change(change_id) ⇒ Object
46 47 48 |
# File 'lib/gerrit.rb', line 46 def change(change_id) Change.new(self, change_id) end |
#get(endpoint) ⇒ Object
7 8 9 |
# File 'lib/gerrit.rb', line 7 def get endpoint request endpoint end |
#post(endpoint, body = '') ⇒ Object
11 12 13 |
# File 'lib/gerrit.rb', line 11 def post endpoint, body = '' request endpoint, method: 'post', body: body.to_s end |
#put(endpoint, body = {}) ⇒ Object
15 16 17 |
# File 'lib/gerrit.rb', line 15 def put endpoint, body = {} request endpoint, method: 'put', body: JSON.dump(body) end |