Method: Syncmind::PersonalityQuiz.group_focus

Defined in:
lib/syncmind.rb

.group_focusObject

Do you work best in groups, or work best alone?



412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
# File 'lib/syncmind.rb', line 412

def self.group_focus
  system("clear")

  print "
  Do you like to work with other people?
  
  [A] I want to find a team mate to work with.
  [B] I want to me left alone so I can work.
  
  >> "; answer = gets.chomp
  
  if    answer == "A" # Writes A answer to script file.
    old_script = File.read("data/script.txt")
  
    open("data/script.txt", "w") { |f|
      f.puts "I want to find a team mate to work with."
      
      f.puts old_script
    }
  elsif answer == "B" # Writes B answer to script file.
    old_script = File.read("data/script.txt")
  
    open("data/script.txt", "w") { |f|
      f.puts "I want to me left alone so I can work."
      
      f.puts old_script
    }
  else                # Picks a default answer.
    old_script = File.read("data/script.txt")
  
    open("data/script.txt", "w") { |f|
      f.puts "I want to me left alone so I can work."
      
      f.puts old_script
    }
  end
end