Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/is_decent.rb
Constant Summary collapse
- INDECENT_WORDS =
%w(shit piss fuck cunt cocksucker motherfucker tits)
Instance Method Summary collapse
Instance Method Details
#is_decent? ⇒ Boolean
3 4 5 6 |
# File 'lib/is_decent.rb', line 3 def is_decent? essence = self.downcase.gsub(/[^a-zA-Z]/, '') INDECENT_WORDS.detect { |c| essence.include? c }.nil? end |