Class: Gerrit

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

Defined Under Namespace

Classes: Change

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#base_urlObject

Returns the value of attribute base_url

Returns:

  • (Object)

    the current value of base_url



5
6
7
# File 'lib/gerrit.rb', line 5

def base_url
  @base_url
end

#passwordObject

Returns the value of attribute password

Returns:

  • (Object)

    the current value of password



5
6
7
# File 'lib/gerrit.rb', line 5

def password
  @password
end

#usernameObject

Returns the value of attribute username

Returns:

  • (Object)

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