Class: MOCO::User
- Inherits:
-
BaseEntity
- Object
- BaseEntity
- MOCO::User
- Defined in:
- lib/moco/entities.rb,
lib/moco/entities/user.rb
Overview
Represents a MOCO user Provides methods for user-specific operations and associations
Instance Attribute Summary collapse
-
#firstname ⇒ Object
Returns the value of attribute firstname.
-
#id ⇒ Object
Returns the value of attribute id.
-
#lastname ⇒ Object
Returns the value of attribute lastname.
Attributes inherited from BaseEntity
Instance Method Summary collapse
-
#activities ⇒ Object
Associations.
- #full_name ⇒ Object
- #holidays ⇒ Object
-
#performance_report ⇒ Object
Instance methods for user-specific operations.
- #presences ⇒ Object
- #to_s ⇒ Object
Methods inherited from BaseEntity
#==, #association, #destroy, #eql?, #has_many, #hash, #initialize, #inspect, #reload, #save, #to_h, #to_json, #update
Constructor Details
This class inherits a constructor from MOCO::BaseEntity
Instance Attribute Details
#firstname ⇒ Object
Returns the value of attribute firstname.
91 92 93 |
# File 'lib/moco/entities.rb', line 91 def firstname @firstname end |
#id ⇒ Object
Returns the value of attribute id.
91 92 93 |
# File 'lib/moco/entities.rb', line 91 def id @id end |
#lastname ⇒ Object
Returns the value of attribute lastname.
91 92 93 |
# File 'lib/moco/entities.rb', line 91 def lastname @lastname end |
Instance Method Details
#activities ⇒ Object
Associations
13 14 15 |
# File 'lib/moco/entities/user.rb', line 13 def activities has_many(:activities) end |
#full_name ⇒ Object
25 26 27 |
# File 'lib/moco/entities/user.rb', line 25 def full_name "#{firstname} #{lastname}" end |
#holidays ⇒ Object
21 22 23 |
# File 'lib/moco/entities/user.rb', line 21 def holidays has_many(:holidays) end |
#performance_report ⇒ Object
Instance methods for user-specific operations
8 9 10 |
# File 'lib/moco/entities/user.rb', line 8 def performance_report client.get("users/#{id}/performance_report") end |
#presences ⇒ Object
17 18 19 |
# File 'lib/moco/entities/user.rb', line 17 def presences has_many(:presences) end |
#to_s ⇒ Object
29 30 31 |
# File 'lib/moco/entities/user.rb', line 29 def to_s full_name end |