Module: Normatron::Filters::BlankFilter
- Defined in:
- lib/normatron/filters/blank_filter.rb
Overview
Returns nil for a blank string or the string itself otherwise.
Class Method Summary collapse
-
.call(input) ⇒ String?
Performs input conversion according to filter requirements.
Class Method Details
.call(input) ⇒ String?
Performs input conversion according to filter requirements.
This method returns the object itself when the first argument is not a String.
28 29 30 |
# File 'lib/normatron/filters/blank_filter.rb', line 28 def self.call(input) input.kind_of?(String) && input.blank? ? nil : input end |