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.



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

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

Instance Attribute Details

#emailObject

Returns the value of attribute email.



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

def email
  @email
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

Class Method Details

.allObject



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

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

.meObject



8
9
10
# File 'lib/GitLab/user.rb', line 8

def self.me 
  GitLab.request_get("projects/#{$GITLAB_PROJECT_ID}/users?search=#{$GITLAB_EMAIL}")[0]
end

Instance Method Details

#to_sObject



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

def to_s
end