Class: LittleWeasel::Filters::EnUs::CurrencyFilter
- Inherits:
-
WordFilter
- Object
- WordFilter
- LittleWeasel::Filters::EnUs::CurrencyFilter
- Defined in:
- lib/LittleWeasel/filters/en_us/currency_filter.rb
Overview
This class represents a currency filter.
Instance Attribute Summary
Attributes inherited from WordFilter
Class Method Summary collapse
Methods inherited from WordFilter
#filter_match?, #filter_off!, #filter_off?, #filter_on!, #filter_on?, #initialize
Methods included from Modules::ClassNameToSymbol
Constructor Details
This class inherits a constructor from LittleWeasel::Filters::WordFilter
Class Method Details
.filter_match?(word) ⇒ Boolean
12 13 14 |
# File 'lib/LittleWeasel/filters/en_us/currency_filter.rb', line 12 def filter_match?(word) /^[-+]?\$[[:digit:]]{1,3}(?:,?[[:digit:]]{3})*(?:\.[[:digit:]]{2})?$/.match? word.to_s end |