Sha256: 39791e157fa3ec24fa014842e3808278ff7141430a9ab94b16723d034ed946f2

Contents?: true

Size: 552 Bytes

Versions: 6

Compression:

Stored size: 552 Bytes

Contents

require "amakanize/filters/base_filter"

module Amakanize
  module Filters
    class TrailingSeriesNamePayloadDeletionFilter < ::Amakanize::Filters::BaseFilter
      PAYLOADS = %w(
        通常版
        (未分類)
      )

      # @note Override
      # @param output [String] e.g. `"魔法使いの嫁 通常版"`
      # @return [Hash] e.g. `"魔法使いの嫁"`
      def call(context:, output:)
        {
          context: context,
          output: output.gsub(/\s+#{::Regexp.union(PAYLOADS)}\z/, ""),
        }
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
amakanize-0.7.0 lib/amakanize/filters/trailing_series_name_payload_deletion_filter.rb
amakanize-0.6.5 lib/amakanize/filters/trailing_series_name_payload_deletion_filter.rb
amakanize-0.6.4 lib/amakanize/filters/trailing_series_name_payload_deletion_filter.rb
amakanize-0.6.3 lib/amakanize/filters/trailing_series_name_payload_deletion_filter.rb
amakanize-0.6.2 lib/amakanize/filters/trailing_series_name_payload_deletion_filter.rb
amakanize-0.6.1 lib/amakanize/filters/trailing_series_name_payload_deletion_filter.rb