Class: String

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

Instance Method Summary collapse

Instance Method Details

#uniq_vowelsObject



13
14
15
# File 'lib/find_vowels.rb', line 13

def uniq_vowels
  scan(/[aeiou]/i).uniq
end

#vowelsObject



9
10
11
# File 'lib/find_vowels.rb', line 9

def vowels
  scan(/[aeiou]/i)
end

#vowels_countObject



17
18
19
20
# File 'lib/find_vowels.rb', line 17

def vowels_count
  arr = scan(/[aeiou]/i)
  arr.each_with_object(Hash.new(0)) { |e, hash| hash[e] += 1 }
end