Class: Harvest::UserAssignment
- Inherits:
-
Hashie::Mash
- Object
- Hashie::Mash
- Harvest::UserAssignment
- Includes:
- Model
- Defined in:
- lib/harvest/user_assignment.rb
Instance Method Summary collapse
- #active? ⇒ Boolean
-
#initialize(args = {}, _ = nil) ⇒ UserAssignment
constructor
A new instance of UserAssignment.
- #project=(project) ⇒ Object
- #user=(user) ⇒ Object
Methods included from Model
Constructor Details
#initialize(args = {}, _ = nil) ⇒ UserAssignment
Returns a new instance of UserAssignment.
7 8 9 10 11 12 13 |
# File 'lib/harvest/user_assignment.rb', line 7 def initialize(args = {}, _ = nil) args = args.stringify_keys self.user = args.delete('user') if args['user'] self.project = args.delete('project') if args['project'] super end |
Instance Method Details
#active? ⇒ Boolean
23 24 25 |
# File 'lib/harvest/user_assignment.rb', line 23 def active? !deactivated end |
#project=(project) ⇒ Object
19 20 21 |
# File 'lib/harvest/user_assignment.rb', line 19 def project=(project) self['project_id'] = project['id'] end |
#user=(user) ⇒ Object
15 16 17 |
# File 'lib/harvest/user_assignment.rb', line 15 def user=(user) self['user_id'] = user['id'] end |