Class: Rosette::Core::PreprocessorId

Inherits:
Resolver
  • Object
show all
Defined in:
lib/rosette/core/resolvers/preprocessor_id.rb

Overview

Logic for handling preprocessor ids. Preprocessor ids are strings that refer to a particular preprocessor class. For example, the id 'normalization' refers to Rosette::Preprocessors::NormalizationPreprocessor.

Examples:

PreprocessorId.resolve('normalization')# => Rosette::Preprocessors::NormalizationPreprocessor

Class Method Summary collapse

Methods inherited from Resolver

parse_id

Class Method Details

.resolve(preprocessor_id, namespace = Rosette::Preprocessors) ⇒ Class

Parses and identifies the class constant for the given preprocessor id.

Parameters:

  • preprocessor_id (Class, String)

    When given a class, returns the class. When given a string, parses and identifies the corresponding class constant in namespace.

  • namespace (Class) (defaults to: Rosette::Preprocessors)

    The namespace to look in.

Returns:

  • (Class)

    The identified class constant.


24
25
26
# File 'lib/rosette/core/resolvers/preprocessor_id.rb', line 24

def resolve(preprocessor_id, namespace = Rosette::Preprocessors)
  super
end