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



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

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

.meObject



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

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

  return user if user

  raise "Who are you?! \nVerify your data em .env"
end

Instance Method Details

#to_sObject



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

def to_s; end