Class: Harvest::UserAssignment

Inherits:
BaseModel show all
Includes:
HappyMapper
Defined in:
lib/harvest/user_assignment.rb

Instance Method Summary collapse

Methods inherited from BaseModel

#==, api_path, #attributes=, #initialize, #to_i, #to_xml

Constructor Details

This class inherits a constructor from Harvest::BaseModel

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/harvest/user_assignment.rb', line 21

def active?
  !deactivated
end

#project=(project) ⇒ Object



17
18
19
# File 'lib/harvest/user_assignment.rb', line 17

def project=(project)
  @project_id = project.to_i
end

#user=(user) ⇒ Object



13
14
15
# File 'lib/harvest/user_assignment.rb', line 13

def user=(user)
  @user_id = user.to_i
end

#user_xmlObject



25
26
27
28
29
30
# File 'lib/harvest/user_assignment.rb', line 25

def user_xml
  builder = Builder::XmlMarkup.new
  builder.user do |t|
    t.id(user_id)
  end
end