Class: Gerrit::Change

Inherits:
Struct
  • Object
show all
Defined in:
lib/gerrit.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#change_idObject

Returns the value of attribute change_id

Returns:

  • (Object)

    the current value of change_id



19
20
21
# File 'lib/gerrit.rb', line 19

def change_id
  @change_id
end

#gerritObject

Returns the value of attribute gerrit

Returns:

  • (Object)

    the current value of 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

#numberObject



20
21
22
# File 'lib/gerrit.rb', line 20

def number
  @number ||= get['_number']
end

#ownerObject



36
37
38
# File 'lib/gerrit.rb', line 36

def owner
  get('detail')['owner']['username']
end

#projectObject



24
25
26
# File 'lib/gerrit.rb', line 24

def project
  @project ||= get['project']
end

#reviewersObject



28
29
30
# File 'lib/gerrit.rb', line 28

def reviewers
  get('reviewers').map {|x| x['username']}.compact
end

#revisionsObject



32
33
34
# File 'lib/gerrit.rb', line 32

def revisions
  get('?o=ALL_REVISIONS')['revisions']
end