Sha256: 7e9a8e687ddfb12d8234f8443f5f7c08f0752c2599cdf49e1d561a7e2c166f7e
Contents?: true
Size: 415 Bytes
Versions: 3
Compression:
Stored size: 415 Bytes
Contents
module Amakanize module Filters class TrailingAuthorNamePayloadDeletionFilter < BaseFilter PAYLOADS = %w( その他 ほか 他 ) # @note Override # @param string [String] e.g. `"ハノカゲ ほか"` # @return [String] e.g. `"ハノカゲ"` def call(string) string.gsub(/\s+#{::Regexp.union(PAYLOADS)}\z/, "") end end end end
Version data entries
3 entries across 3 versions & 1 rubygems