Sha256: 4741fea9b6cd01677db4fc33594dd5c40d8081a5f3814615458f3e0b368183cc

Contents?: true

Size: 733 Bytes

Versions: 6

Compression:

Stored size: 733 Bytes

Contents

# frozen_string_literal: true

class Serega
  module Plugins
    module StringModifiers
      def self.plugin_name
        :string_modifiers
      end

      def self.load_plugin(serializer_class, **_opts)
        serializer_class.include(InstanceMethods)
        require_relative "./parse_string_modifiers"
      end

      module InstanceMethods
        private

        def prepare_modifiers(opts)
          opts = {
            only: ParseStringModifiers.call(opts[:only]),
            except: ParseStringModifiers.call(opts[:except]),
            with: ParseStringModifiers.call(opts[:with])
          }

          super
        end
      end
    end

    register_plugin(StringModifiers.plugin_name, StringModifiers)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
serega-0.1.5 lib/serega/plugins/string_modifiers/string_modifiers.rb
serega-0.1.4 lib/serega/plugins/string_modifiers/string_modifiers.rb
serega-0.1.3 lib/serega/plugins/string_modifiers/string_modifiers.rb
serega-0.1.2 lib/serega/plugins/string_modifiers/string_modifiers.rb
serega-0.1.1 lib/serega/plugins/string_modifiers/string_modifiers.rb
serega-0.1.0 lib/serega/plugins/string_modifiers/string_modifiers.rb