# if statements as ternaries hour = 14 ampm = if hour >= 12 then "pm" else "am" end puts "#{hour} #{ampm}" # embedding a case statement inside a string concatenation obj = 5 puts "I am a " + case when obj.is_a?( Fixnum ) then "number" when obj.is_a?( String ) then "string" when obj.is_a?( Politician ) then "moron" else "object" end + " or something like that" # the "ruby way" to do loops (0..5).each do |i| puts i end