Module: Normatron::Filters::ChompFilter
- Defined in:
- lib/normatron/filters/chomp_filter.rb
Class Method Summary collapse
-
.evaluate(input, separator = $/) ⇒ String
Remove the given record separator from the end of the string (If present).
Class Method Details
.evaluate(input, separator = $/) ⇒ String
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
).
29 30 31 |
# File 'lib/normatron/filters/chomp_filter.rb', line 29 def self.evaluate(input, separator=$/) input.kind_of?(String) ? input.chomp(separator) : input end |