Class: GitLab::User
- Inherits:
-
Object
- Object
- GitLab::User
- Defined in:
- lib/GitLab/user.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ User
constructor
A new instance of User.
- #to_s ⇒ Object
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
#email ⇒ Object
Returns the value of attribute email.
3 4 5 |
# File 'lib/GitLab/user.rb', line 3 def email @email end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/GitLab/user.rb', line 3 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/GitLab/user.rb', line 3 def name @name end |
Class Method Details
.all ⇒ Object
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 |
.me ⇒ Object
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_s ⇒ Object
20 |
# File 'lib/GitLab/user.rb', line 20 def to_s; end |