Module: ExplicitWords
- Defined in:
- lib/explicit_words.rb,
lib/explicit_words/version.rb
Constant Summary collapse
- EXPLICIT_WORDS =
File.open(File.('../explicit_words.txt', __FILE__)).readlines.collect { |word| word.downcase.chomp }
- VERSION =
'0.0.1'
Class Method Summary collapse
Class Method Details
.check(content) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/explicit_words.rb', line 7 def self.check(content) explicit_content = false content.scan(/[\w]+/).each do |word| explicit_content = true if EXPLICIT_WORDS.include?(word.downcase) end explicit_content end |