Class: Wordini

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

Class Method Summary collapse

Class Method Details

.obfuscate(word_string, words_to_remove) ⇒ Object



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

def self.obfuscate(word_string, words_to_remove)
	split_words = word_string.split.map{ |word| 
		if words_to_remove.include? word
			word = "*" * word.split('').count
		else
			word = word
		end
		}.join(' ')
end