Sha256: a7d9a3a34577ea3ea7cabb920236283880cb71aac587837efc0b28f73a872009

Contents?: true

Size: 511 Bytes

Versions: 5

Compression:

Stored size: 511 Bytes

Contents

module Amakanize
  module Filters
    class TrailingParenthesesDeletionFilter < 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

5 entries across 5 versions & 1 rubygems

Version Path
amakanize-0.6.0 lib/amakanize/filters/trailing_parentheses_deletion_filter.rb
amakanize-0.5.3 lib/amakanize/filters/trailing_parentheses_deletion_filter.rb
amakanize-0.5.2 lib/amakanize/filters/trailing_parentheses_deletion_filter.rb
amakanize-0.5.1 lib/amakanize/filters/trailing_parentheses_deletion_filter.rb
amakanize-0.5.0 lib/amakanize/filters/trailing_parentheses_deletion_filter.rb