Class: WorkTogether::Group

Inherits:
Object
  • Object
show all
Defined in:
lib/work_together.rb

Class Method Summary collapse

Class Method Details

.allObject



105
106
107
# File 'lib/work_together.rb', line 105

def self.all
  Table.all
end

.all_studentsObject



109
110
111
112
113
114
115
# File 'lib/work_together.rb', line 109

def self.all_students
  self.all.map do |group|
    group.students.map do |student|
      student
    end
  end.flatten
end

.display_groupsObject



117
118
119
120
121
122
123
124
125
# File 'lib/work_together.rb', line 117

def self.display_groups
  Table.all.each_with_index do |table, i|
    puts "Group #{i + 1}:".colorize(:blue)
    table.students.each do |student|
      puts student.name.colorize(:light_blue)
    end
    puts "-------------------".colorize(:blue)
  end
end