Sha256: 46d1b6efbe8218a8c9b9d24426ec501da8c509dc9c80d575dfeeebce46a8eba0

Contents?: true

Size: 574 Bytes

Versions: 6

Compression:

Stored size: 574 Bytes

Contents

require "amakanize/filters/base_filter"

module Amakanize
  module Filters
    class TrailingParenthesesDeletionFilter < ::Amakanize::Filters::BaseFilter
      # @note Override
      # @param output [String] e.g. `"魔法使いの嫁 通常版 4 (BLADE COMICS)"`
      # @return [Hash] e.g. `"魔法使いの嫁 通常版 4"`
      def call(context:, output:)
        unless context[:volume_number_removed]
          output = output.sub(/\s*\([^\(]+\)\z/, "")
        end
        {
          context: context,
          output: output,
        }
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

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