Module: Normatron::Filters::UpcaseFilter

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

Class Method Summary collapse

Methods included from Helpers

acronym_regex, acronyms, evaluate_regexp, inflections, mb_send

Class Method Details

.evaluate(input) ⇒ String

Uppercase all characters.

Examples:

UpcaseFilter.evaluate("borderlands") #=> "BORDERLANDS"

Using as ActiveRecord::Base normalizer

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

See Also:



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

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