class PhoneBedroom::BedroomTest

Public Class Methods

from_data_jabber() click to toggle source
# File lib/phone_bedroom.rb, line 7
def self.from_data_jabber
  require "tts"
  
  pet_data = [
    "cat",     "dog",    "rat",
    "hamster", "gerbil", "guiniepig",
    "monkey",  "snake",
  ]
  
  bedroom_data = [
    "bedroom", "closet"
  ]
  
  house_data = [
    "cottage",   "longhouse",
    "apartment", "studio",
  ]
  
  active_pet     = pet_data.sample
  active_bedroom = bedroom_data.sample
  active_house   = house_data.sample
  
  "An animal is sleeping in my bed. My #{active_pet} is the only animal in my #{active_house}. Therefore it is my #{active_pet} that is sleeping on me.".to_file "en"
  
  system('play-audio "An animal is sleeping.mp3"; rm "An animal is sleeping.mp3"')
end