Class: Filter::Email

Inherits:
Filter show all
Defined in:
lib/filters/email.rb

Constant Summary collapse

EMAIL =

– Constants ++

/[\w!#$\%'*-\/=?^_`{|}~.]+@(?:(?:[\w\-]+\.)+)[a-z]{2,4}\b/

Constants inherited from Filter

VERSION

Instance Attribute Summary

Attributes inherited from Filter

#string

Instance Method Summary collapse

Methods inherited from Filter

Profanity, Profanity!, #filter, inherited, #initialize

Constructor Details

This class inherits a constructor from Filter

Instance Method Details

#filter!Object

Convert emails to anchor tags.



13
14
15
16
# File 'lib/filters/email.rb', line 13

def filter!
  string.gsub! EMAIL, '<a href="mailto:\0">\0</a>'
  string
end