Module: Washcloth

Defined in:
lib/washcloth.rb,
lib/washcloth/version.rb

Defined Under Namespace

Modules: Filters, Formatters, Internal Classes: Configuration, Error, Filter

Constant Summary collapse

VERSION =
"0.1.1"

Class Method Summary collapse

Class Method Details

.clean(value) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/washcloth.rb', line 18

def self.clean(value)
  Internal.configuration.filters.inject(value) do |memo, (_, filter)|
    Formatters::ActiveRecord.new(filter).run(
      Formatters::Xml.new(filter).run(memo)
    )
  end
end

.filter(value, filter: filters.chars("*")) ⇒ Object



14
15
16
# File 'lib/washcloth.rb', line 14

def self.filter(value, filter: filters.chars("*"))
  Internal.add_filter(value, filter)
end

.filtersObject



26
27
28
# File 'lib/washcloth.rb', line 26

def self.filters
  Filters
end

.resetObject



10
11
12
# File 'lib/washcloth.rb', line 10

def self.reset
  Internal.reset
end