Class: Artisan::Member

Inherits:
Object
  • Object
show all
Defined in:
lib/artisan/teams/member.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(member) ⇒ Member

Returns a new instance of Member.



6
7
8
# File 'lib/artisan/teams/member.rb', line 6

def initialize(member)
  @member = member
end

Instance Attribute Details

#memberObject

Returns the value of attribute member.



4
5
6
# File 'lib/artisan/teams/member.rb', line 4

def member
  @member
end

Instance Method Details

#add_to_assigned_listObject



17
18
19
20
21
22
# File 'lib/artisan/teams/member.rb', line 17

def add_to_assigned_list
  if !config.nil?
    config.story_assigned_email_list << @member.user.email
    config.save!
  end
end

#add_to_completed_listObject



10
11
12
13
14
15
# File 'lib/artisan/teams/member.rb', line 10

def add_to_completed_list
  if !config.nil?
    config.story_completed_email_list << @member.user.email
    config.save!
  end
end

#remove_from_assigned_listObject



31
32
33
34
35
36
# File 'lib/artisan/teams/member.rb', line 31

def remove_from_assigned_list
  if !config.nil?
    config.story_assigned_email_list.delete(@member.user.email)
    config.save!
  end
end

#remove_from_completed_listObject



24
25
26
27
28
29
# File 'lib/artisan/teams/member.rb', line 24

def remove_from_completed_list
  if !config.nil?
    config.story_completed_email_list.delete(@member.user.email)
    config.save!
  end
end

#remove_from_email_listsObject



38
39
40
41
42
43
44
# File 'lib/artisan/teams/member.rb', line 38

def remove_from_email_lists
  if !config.nil?
    config.story_completed_email_list.delete(@member.user.email)
    config.story_assigned_email_list.delete(@member.user.email)
    config.save!
  end
end