Class: GitLab::User

Inherits:
Object
  • Object
show all
Defined in:
lib/GitLab/user.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ User

Returns a new instance of User.



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

def initialize(params = {})
  @name = params[:name]
end

Instance Attribute Details

#emailObject

Returns the value of attribute email.



3
4
5
# File 'lib/GitLab/user.rb', line 3

def email
  @email
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/GitLab/user.rb', line 3

def id
  @id
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/GitLab/user.rb', line 3

def name
  @name
end

Class Method Details

.allObject



16
17
18
# File 'lib/GitLab/user.rb', line 16

def self.all
  GitLab.request_get("projects/#{$GITLAB_PROJECT_ID}/users?per_page=100")
end

.meObject



9
10
11
12
13
14
# File 'lib/GitLab/user.rb', line 9

def self.me
  user = GitLab.request_get('user')
  return user if user

  raise "Quem é você? \nNão consegui localizar seu usuário no gitlab,\nTente novamente mais tarde ou verifique o arquivos de configuração."
end

Instance Method Details

#to_sObject



20
# File 'lib/GitLab/user.rb', line 20

def to_s; end