Sha256: 7b1a940a61e004b73c77e48b50c37f56b239c8cfa893db29857886fa255b4720
Contents?: true
Size: 383 Bytes
Versions: 11
Compression:
Stored size: 383 Bytes
Contents
# frozen_string_literal: true module Normalizy module Filters module Strip def self.call(input, options = {}) return input unless input.is_a?(String) regex = { both: '\A\s*|\s*\z', left: '\A\s*', right: '\s*\z' }[options[:side] || :both] input.gsub Regexp.new(/#{regex}/), '' end end end end
Version data entries
11 entries across 11 versions & 1 rubygems