Class: Table

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

Constant Summary collapse

@@all =
[]

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(student_array) ⇒ Table

Returns a new instance of Table.



4
5
6
7
# File 'lib/work_together/table.rb', line 4

def initialize(student_array)
  @students = student_array
  @@all << self unless student_array.include?([])
end

Class Method Details

.allObject



13
14
15
# File 'lib/work_together/table.rb', line 13

def self.all
  @@all
end

.all_studentsObject



17
18
19
20
21
# File 'lib/work_together/table.rb', line 17

def self.all_students
  self.all.map do |table|
    table.students
  end
end

Instance Method Details

#studentsObject



9
10
11
# File 'lib/work_together/table.rb', line 9

def students
  @students
end