Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/hiwai/object.rb
Instance Method Summary collapse
Instance Method Details
#censored ⇒ Object
18 19 20 |
# File 'lib/hiwai/object.rb', line 18 def censored @hiwai_matches end |
#hiwai! ⇒ Object
14 15 16 |
# File 'lib/hiwai/object.rb', line 14 def hiwai! raise Hiwai::Censored, 'Receiver includes hiwai object' if hiwai? end |
#hiwai? ⇒ Boolean
4 5 6 7 8 9 10 11 12 |
# File 'lib/hiwai/object.rb', line 4 def hiwai? string = to_s @hiwai_matches = Hiwai.censorable_words.select {|word| string.match Hiwai::MaskedRegexp.new(word) } @hiwai_matches.any? end |