Class: Filter::Email
Constant Summary collapse
- EMAIL =
– Constants ++
/[\w!#$\%'*-\/=?^_`{|}~.]+@(?:(?:[\w\-]+\.)+)[a-z]{2,4}\b/
Constants inherited from Filter
Instance Attribute Summary
Attributes inherited from Filter
Instance Method Summary collapse
-
#filter! ⇒ Object
Convert emails to anchor tags.
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 |