Class: InsultGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/insult_generator.rb

Class Method Summary collapse

Class Method Details

.random_insultObject



4
5
6
7
8
9
10
# File 'lib/insult_generator.rb', line 4

def self.random_insult
  data = YAML.load_file(File.expand_path("lib/data/insults.yml"))
  column1_rand = data["column1"][rand(50)]
  column2_rand = data["column2"][rand(50)]
  column3_rand = data["column3"][rand(50)]
  "Thou #{column1_rand} #{column2_rand} #{column3_rand} build!"
end