Sha256: 91216dd57829252952994248d36bb73636685c506e36927ab8461d9d4a467132

Contents?: true

Size: 676 Bytes

Versions: 6

Compression:

Stored size: 676 Bytes

Contents

require "amakanize/filters/base_filter"

module Amakanize
  module Filters
    class VideoPositionDetectionFilter < ::Amakanize::Filters::BaseFilter
      # @note Override
      # @param output [String] e.g. `"第1話「でじこだにょ」/第2話「ぷちこと一緒かにょ?」"`
      # @return [Hash] e.g. `"1"`
      def call(context:, output:)
        output = begin
          if output.match(/#{::Amakanize::PATTERN_OF_VOLUME_PREFIX}(#{PATTERN_OF_NUMERIC_CHARACTERS})/)
            ::Regexp.last_match(1)
          else
            ""
          end
        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/video_position_detection_filter.rb
amakanize-0.6.5 lib/amakanize/filters/video_position_detection_filter.rb
amakanize-0.6.4 lib/amakanize/filters/video_position_detection_filter.rb
amakanize-0.6.3 lib/amakanize/filters/video_position_detection_filter.rb
amakanize-0.6.2 lib/amakanize/filters/video_position_detection_filter.rb
amakanize-0.6.1 lib/amakanize/filters/video_position_detection_filter.rb