Sha256: eea90d0388a1a3548b40063cd7285926276c128b25d5b49940c26f5ca63631cf
Contents?: true
Size: 460 Bytes
Versions: 24
Compression:
Stored size: 460 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
24 entries across 24 versions & 1 rubygems