class NameGen::RandGenerator
Constants
- CONS
- OPTIONS
- VOWELS
Public Class Methods
new()
click to toggle source
# File lib/name_gen/rand_generator.rb, line 8 def initialize end
Public Instance Methods
get_name(elements)
click to toggle source
# File lib/name_gen/rand_generator.rb, line 11 def get_name(elements) result_name = [] elements.times do result_name << get_syllable end result_name.join.capitalize end
Private Instance Methods
get_syllable()
click to toggle source
# File lib/name_gen/rand_generator.rb, line 23 def get_syllable case OPTIONS.sample when :con1_vow1 [].push(CONS.sample).push(VOWELS.sample).shuffle.join when :con1_vow2 [].push(CONS.sample).push(VOWELS.sample).push(VOWELS.sample).shuffle.join when :con1 CONS.sample when :vow1 VOWELS.sample end end