Class: Table
- Inherits:
-
Object
- Object
- Table
- Defined in:
- lib/work_together/table.rb
Constant Summary collapse
- @@all =
[]
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(student_array) ⇒ Table
constructor
A new instance of Table.
- #students ⇒ Object
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
.all ⇒ Object
13 14 15 |
# File 'lib/work_together/table.rb', line 13 def self.all @@all end |
.all_students ⇒ Object
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
#students ⇒ Object
9 10 11 |
# File 'lib/work_together/table.rb', line 9 def students @students end |