Class: Gerrit::Change
- Inherits:
-
Struct
- Object
- Struct
- Gerrit::Change
- Defined in:
- lib/gerrit.rb
Instance Attribute Summary collapse
-
#change_id ⇒ Object
Returns the value of attribute change_id.
-
#gerrit ⇒ Object
Returns the value of attribute gerrit.
Instance Method Summary collapse
- #get(subpath = '') ⇒ Object
- #number ⇒ Object
- #owner ⇒ Object
- #project ⇒ Object
- #reviewers ⇒ Object
- #revisions ⇒ Object
Instance Attribute Details
#change_id ⇒ Object
Returns the value of attribute change_id
19 20 21 |
# File 'lib/gerrit.rb', line 19 def change_id @change_id end |
#gerrit ⇒ Object
Returns the value of attribute gerrit
19 20 21 |
# File 'lib/gerrit.rb', line 19 def gerrit @gerrit end |
Instance Method Details
#get(subpath = '') ⇒ Object
40 41 42 43 |
# File 'lib/gerrit.rb', line 40 def get subpath='' path = File.join("changes/#{change_id}", subpath) gerrit.get path end |
#number ⇒ Object
20 21 22 |
# File 'lib/gerrit.rb', line 20 def number @number ||= get['_number'] end |
#owner ⇒ Object
36 37 38 |
# File 'lib/gerrit.rb', line 36 def owner get('detail')['owner']['username'] end |
#project ⇒ Object
24 25 26 |
# File 'lib/gerrit.rb', line 24 def project @project ||= get['project'] end |
#reviewers ⇒ Object
28 29 30 |
# File 'lib/gerrit.rb', line 28 def reviewers get('reviewers').map {|x| x['username']}.compact end |
#revisions ⇒ Object
32 33 34 |
# File 'lib/gerrit.rb', line 32 def revisions get('?o=ALL_REVISIONS')['revisions'] end |