Class: WorkTogether::Group

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

Class Method Summary collapse

Class Method Details

.allObject



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

def self.all
  Table.all
end

.all_studentsObject



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

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

.display_groupsObject



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

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