fork download
  1. class String
  2.  
  3. # The parts of my daughter's organ
  4. # instructor's name.
  5. @@syllables = [
  6. { 'Paij' => 'Personal',
  7. 'Gonk' => 'Business',
  8. 'Blon' => 'Slave',
  9. 'Stro' => 'Master',
  10. 'Wert' => 'Father',
  11. 'Onnn' => 'Mother' },
  12. { 'ree' => 'AM',
  13. 'plo' => 'PM' }
  14. ]
  15.  
  16. # A method to determine what a
  17. # certain name of his means.
  18. def name_significance
  19. parts = self.split( '-' )
  20. syllables = @@syllables.dup
  21. signif = parts.collect do |p|
  22. syllables.shift[p]
  23. end
  24. signif.join( ' ' )
  25. end
  26.  
  27. end
  28.  
  29. print "Paij-ree".name_significance
Success #stdin #stdout 0.01s 7412KB
stdin
Standard input is empty
stdout
Personal AM