Module: Normatron::Filters::ChompFilter
- Defined in:
- lib/normatron/filters/chomp_filter.rb
Overview
Remove the given record separator from the end of the string (If present).
If $/
has not been changed from the default Ruby record separator, then chomp also removes carriage return
characters (that is it will remove \n
, \r
, and \r\n
).
Class Method Summary collapse
-
.call(input, separator = $/) ⇒ String
Performs input conversion according to filter requirements.
Class Method Details
.call(input, separator = $/) ⇒ String
Performs input conversion according to filter requirements.
This method returns the object itself when the first argument is not a String.
35 36 37 |
# File 'lib/normatron/filters/chomp_filter.rb', line 35 def self.call(input, separator=$/) input.kind_of?(String) ? input.chomp(separator) : input end |