Sha256: 7b4ce744317e3021c92c30f8817af0e161490ce91ecb0ba11ba8f3edf1ac6b34

Contents?: true

Size: 424 Bytes

Versions: 6

Compression:

Stored size: 424 Bytes

Contents

require "amakanize/filters/base_filter"

module Amakanize
  module Filters
    class BookPositionNumberCanonicalizationFilter < ::Amakanize::Filters::BaseFilter
      # @note Override
      def call(context:, output:)
        if context[:position_detected]
          output = output.gsub(/\A0+([1-9]+)/, '\1')
        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/book_position_number_canonicalization_filter.rb
amakanize-0.6.5 lib/amakanize/filters/book_position_number_canonicalization_filter.rb
amakanize-0.6.4 lib/amakanize/filters/book_position_number_canonicalization_filter.rb
amakanize-0.6.3 lib/amakanize/filters/book_position_number_canonicalization_filter.rb
amakanize-0.6.2 lib/amakanize/filters/book_position_number_canonicalization_filter.rb
amakanize-0.6.1 lib/amakanize/filters/book_position_number_canonicalization_filter.rb