class RulesAi::Chatbot

Public Class Methods

bianca_hobby() click to toggle source
# File lib/rules_ai.rb, line 460
def self.bianca_hobby
  bot_name  = File.read("bot_identity/name.txt").strip
  your_name = File.read("usr_identity/name.txt").strip

  puts "#{bot_name}: What is your hobby?"
  print "#{your_name}: My hobby is "; my_hobby = gets.chomp

  open("usr_identity/hobby.txt", "w") { |f|
    f.puts my_hobby
  }

  puts "#{bot_name}: You have a nice #{my_hobby}."
end
bianca_jobs() click to toggle source
# File lib/rules_ai.rb, line 474
def self.bianca_jobs
  bot_name  = File.read("bot_identity/name.txt").strip
  your_name = File.read("usr_identity/name.txt").strip

  puts "#{bot_name}: What is your job?"
  print "#{your_name}: My job is "; my_job = gets.chomp

  open("usr_identity/job.txt", "w") { |f|
    f.puts my_job
  }

  puts "#{bot_name}: Sounds like #{my_job} is hard work."
end
bianca_name() click to toggle source
# File lib/rules_ai.rb, line 432
def self.bianca_name
  bot_name  = File.read("bot_identity/name.txt").strip
  your_name = File.read("usr_identity/name.txt").strip

  puts "#{bot_name}: What is your name?"
  print "#{your_name}: My name is "; my_name = gets.chomp

  open("usr_identity/name.txt", "w") { |f|
    f.puts my_name
  }

  puts "#{bot_name}: Nice to meet you, #{my_name}."
end
bianca_pets() click to toggle source
# File lib/rules_ai.rb, line 446
def self.bianca_pets
  bot_name  = File.read("bot_identity/name.txt").strip
  your_name = File.read("usr_identity/name.txt").strip

  puts "#{bot_name}: Do you have a pet?"
  print "#{your_name}: My pet is "; my_pet = gets.chomp

  open("usr_identity/pet.txt", "w") { |f|
    f.puts my_pet
  }

  puts "#{bot_name}: You have a nice #{my_pet}."
end
bianca_skills() click to toggle source
# File lib/rules_ai.rb, line 488
def self.bianca_skills
  bot_name  = File.read("bot_identity/name.txt").strip
  your_name = File.read("usr_identity/name.txt").strip

  puts "#{bot_name}: What is your skill?"
  print "#{your_name}: My skill is "; my_skill = gets.chomp

  open("usr_identity/skill.txt", "w") { |f|
    f.puts my_skill
  }

  puts "#{bot_name}: #{my_skill} sounds like an interesting skill."
end