class MentorGroup
Attributes
members[R]
name[R]
Public Class Methods
create_persisted_mentees(store)
click to toggle source
# File lib/mentor_group.rb, line 14 def self.create_persisted_mentees(store) puts 'What are the names of the people in your group (please separate by a comma followed by a space)?' name_string = gets.chomp new_mentees = name_string.split(', ') mentees = new_mentees.map { |mentee| Student.new(mentee) } store.transaction do store["mentees"] = mentees end return mentees end
new(members = [])
click to toggle source
# File lib/mentor_group.rb, line 4 def initialize(members = []) @members = members end
reset_mentees_option(store)
click to toggle source
# File lib/mentor_group.rb, line 27 def self.reset_mentees_option(store) puts 'Would you like to reset your group and input their names again?' reset_choice = InputValidator.reset_mentees_input if reset_choice == 'y' mentees = self.create_persisted_mentees(store) return mentees else end end
Public Instance Methods
fill_mentor_group(array_of_students)
click to toggle source
# File lib/mentor_group.rb, line 8 def fill_mentor_group(array_of_students) array_of_students.each do |student| @members << student end end