When a Ruby method returns an Array we can immediately loop over the array again, but we can pass arguments to that method on the fly. This makes a nice syntax reducing code. 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 require ‘date’   class School   def initialize @enrolled = [] end   def enrolling(from, to, student) @enrolled << [DateTime.parse(from) .. DateTime.parse(to), student] end   def display_enrolled_students(datetime) dt = DateTime.parse(datetime) puts "_____ Student ______" check_enrollment(dt).each do |range, student| puts "Name: #{student}" end puts "_____ End _______" end  […]

Ruby has an alternative truthfully operator “!!”. Let’s look at some examples. cats = "" def method(cats) if !!cats p "yesss!" end end => nil >> method(cats) "yesss!" => nil A more common way to see this is with a ternary. def method (1..8).include?(7) ? "yesss!" : "nooo!" end => nil   >> method "yesss!" Why might we want to use this method? In most cases I don’t like the “!!”. It is hard to search for in Ruby docs and doesn’t read as nice as other truthy statements, but when creating boolean methods on an object there might be an argument.   someone = nil def possible_surfer?(user) !!user end >> possible_surfer?(someone) => false   def possible_surfer?(user) user end >>[…]