Module: Serega::SeregaPlugins::StringModifiers

Defined in:
lib/serega/plugins/string_modifiers/parse_string_modifiers.rb,
lib/serega/plugins/string_modifiers/string_modifiers.rb

Overview

Modifiers can still be provided old way with nested hashes or arrays.

PostSerializer.new(with: %i[email, username]).to_h(post)

Defined Under Namespace

Modules: InstanceMethods Classes: ParseStringModifiers

Class Method Summary collapse

Class Method Details

.load_plugin(serializer_class, **_opts) ⇒ void

This method returns an undefined value.

Applies plugin code to specific serializer

Parameters:

  • serializer_class (Class<Serega>)

    Current serializer class

  • _opts (Hash)

    Loaded plugins options



19
20
21
22
# File 'lib/serega/plugins/string_modifiers/string_modifiers.rb', line 19

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

.plugin_nameSymbol

Returns Plugin name.

Returns:

  • (Symbol)

    Plugin name



7
8
9
# File 'lib/serega/plugins/string_modifiers/string_modifiers.rb', line 7

def self.plugin_name
  :string_modifiers
end