work_together 0.9.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 03ba0dc9b54f0c537876390d1f758a8077db5cae
4
- data.tar.gz: f75b48e3a44a05854d6a38135a0fb21ec493ca41
3
+ metadata.gz: 71e855c6dadb23628458dac49ec95f41803a640e
4
+ data.tar.gz: a4b1f6b52c818a301d26468ddd85d72e39da28bd
5
5
  SHA512:
6
- metadata.gz: 634f5ca84d53d6fb316e12b6d48771887ba36baf8c95a85c171282e12b42c5fd39709477bc7ab4b5d447f73dd7c73108d7dc3b0907834d6064879c8a3c3abebb
7
- data.tar.gz: af1df77ac1dc6f3611047e64aea1c3d9018f5505bcf9e9d57a74a47695bf4a5b67586b39a6a2ab659736b3e0f4f2b6bb51c092888a8ef86d00816c14827218e3
6
+ metadata.gz: 46c836e0bbdfb0bd608c4e77b5abaad33d18152a7c9e885188a24d54a9d256a9b21b47aa5413873e3a92478250ee0a4396781e1be21800c78b605a2f24794991
7
+ data.tar.gz: 1f4396c294818b31c3e6da4da3f9bc44514b50cb0d165e08f87e98f428c94baf081be771df9c37471a1d8d21ab6a5e65e1ccb38d8f02e59d52235e3532f82891
data/lib/work_together.rb CHANGED
@@ -40,6 +40,8 @@ module WorkTogether
40
40
  pair_maker.public_send("make_pairs_#{flag}", students)
41
41
  elsif options.include?("tables")
42
42
  pair_maker.public_send("make_tables_#{flag}", students)
43
+ elsif options.include?("groups")
44
+ pair_maker.public_send("make_groups", flag, students)
43
45
  elsif options.include?("--help")
44
46
  help
45
47
  else
@@ -96,6 +98,14 @@ module WorkTogether
96
98
  Table.all
97
99
  end
98
100
 
101
+ def self.all_students
102
+ self.all.map do |group|
103
+ group.students.map do |student|
104
+ student
105
+ end
106
+ end.flatten
107
+ end
108
+
99
109
  def self.display_groups
100
110
  Table.all.each_with_index do |table, i|
101
111
  puts "Group #{i + 1}:".colorize(:blue)
@@ -48,6 +48,20 @@ class PairMaker
48
48
  mindful_batch_of_four(two_groups_of_four)
49
49
  end
50
50
 
51
+ def make_groups(num_of_groups, students)
52
+ num_of_groups = students.length/num_of_groups.to_i
53
+ # binding.pry
54
+ students.each_slice(num_of_groups).each do |slice|
55
+ # binding.pry
56
+ if slice.length == 1
57
+ Table.all.last.students << slice.first
58
+ else
59
+ Table.new(slice)
60
+ end
61
+ end
62
+ # binding.pry
63
+ end
64
+
51
65
  private
52
66
 
53
67
  def randomize_students(students)
@@ -13,4 +13,10 @@ class Table
13
13
  def self.all
14
14
  @@all
15
15
  end
16
+
17
+ def self.all_students
18
+ self.all.map do |table|
19
+ table.students
20
+ end
21
+ end
16
22
  end
@@ -1,3 +1,3 @@
1
1
  module WorkTogether
2
- VERSION = "0.9.0"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: work_together
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sophie DeBenedetto