Class: Redminer::User
- Inherits:
-
Object
- Object
- Redminer::User
- Defined in:
- lib/redminer/user.rb
Instance Attribute Summary collapse
-
#firstname ⇒ Object
Returns the value of attribute firstname.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#lastname ⇒ Object
Returns the value of attribute lastname.
-
#login ⇒ Object
Returns the value of attribute login.
-
#mail ⇒ Object
Returns the value of attribute mail.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(server, id = nil) ⇒ User
constructor
A new instance of User.
Constructor Details
#initialize(server, id = nil) ⇒ User
Returns a new instance of User.
6 7 8 |
# File 'lib/redminer/user.rb', line 6 def initialize(server, id = nil) @id = id end |
Instance Attribute Details
#firstname ⇒ Object
Returns the value of attribute firstname.
4 5 6 |
# File 'lib/redminer/user.rb', line 4 def firstname @firstname end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/redminer/user.rb', line 3 def id @id end |
#lastname ⇒ Object
Returns the value of attribute lastname.
4 5 6 |
# File 'lib/redminer/user.rb', line 4 def lastname @lastname end |
#login ⇒ Object
Returns the value of attribute login.
4 5 6 |
# File 'lib/redminer/user.rb', line 4 def login @login end |
#mail ⇒ Object
Returns the value of attribute mail.
4 5 6 |
# File 'lib/redminer/user.rb', line 4 def mail @mail end |
Class Method Details
.current(server) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/redminer/user.rb', line 10 def self.current(server) response = server.get('/users/current.json') origin = response["user"] c_user = self.new(server) c_user.all = origin c_user.instance_variable_get(:@id, origin["id"]) c_user end |