-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathwatchman.rb
More file actions
46 lines (34 loc) · 938 Bytes
/
watchman.rb
File metadata and controls
46 lines (34 loc) · 938 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
require 'rubygems'
require 'bundler/setup'
require "./db/setup"
Dir.glob('./models/*').each { |r| require r}
require "./db/seed"
puts "There are #{Show.count} in the database"
Network.all.each do |network|
puts "Shows airing on #{network}"
network.shows.each do |show| #this is really cool
puts show
end
end
puts "------------------------"
puts "Which day do you want to watch the show?"
day = gets.chomp().capitalize
puts "Shows airing on #{day}"
#Show.all.each do |show|
# puts show if show.day_of_week == day
#end
Show.all.to_a.select{|show| show.day_of_week == day}.each do |show|
puts show
end
puts "-------------------------"
Coffee.all.each do |coffee|
puts coffee.name
end
puts "Which coffee do you want to know more about?"
cof = gets.chomp().capitalize
#Coffee.all.each do |coffee|
# puts coffee if coffee.name == cof
#end
Coffee.all.to_a.select{|coffee| coffee == cof}.each do |coffee|
puts coffee
end