Sha256: 40753de039f869fb4d42cd8e384177a3baef1c57bde630ffca56c71d46b43093

Contents?: true

Size: 403 Bytes

Versions: 7

Compression:

Stored size: 403 Bytes

Contents

module Amakanize
  module Filters
    class RoleNameDeletionFilter < BaseFilter
      ROLE_NAMES = %w(
        原作
        原案
        漫画
      )

      # @note Override
      # @param string [String] e.g. `"漫画:ハノカゲ"`
      # @return [String] e.g. `"ハノカゲ"`
      def call(string)
        string.gsub(%r<\A#{::Regexp.union(ROLE_NAMES)}[:/]>, "")
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
amakanize-0.1.3 lib/amakanize/filters/role_name_deletion_filter.rb
amakanize-0.1.2 lib/amakanize/filters/role_name_deletion_filter.rb
amakanize-0.1.1 lib/amakanize/filters/role_name_deletion_filter.rb
amakanize-0.1.0 lib/amakanize/filters/role_name_deletion_filter.rb
amakanize-0.0.4 lib/amakanize/filters/role_name_deletion_filter.rb
amakanize-0.0.3 lib/amakanize/filters/role_name_deletion_filter.rb
amakanize-0.0.2 lib/amakanize/filters/role_name_deletion_filter.rb