Module: Normatron::Filters::DowncaseFilter

Extended by:
Helpers
Defined in:
lib/normatron/filters/downcase_filter.rb

Class Method Summary collapse

Methods included from Helpers

acronym_regex, acronyms, evaluate_regexp, inflections, mb_send

Class Method Details

.evaluate(input) ⇒ String

Lowercase all characters.

Examples:

DowncaseFilter.evaluate("NOTHING ELSE MATTERS") #=> "nothing else matters"

Using as ActiveRecord::Base normalizer

normalize :attribute_a, :with => :downcase
normalize :attribute_b, :with => [:custom_filter, :downcase]

Parameters:

  • input (String)

    A character sequence

Returns:

  • (String)

    The lowercased character sequence or the object itself

See Also:



24
25
26
# File 'lib/normatron/filters/downcase_filter.rb', line 24

def self.evaluate(input)
  input.kind_of?(String) ? mb_send(:downcase, input) : input
end