Class: Rosette::Core::ExtractorId

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

Overview

Logic for handling extractor ids. Extractor ids are strings that refer to a particular extractor class. For example, the id 'yaml/rails' refers to Rosette::Extractors::YamlExtractor::RailsExtractor.

Examples:

ExtractorId.resolve('yaml/rails')
# => Rosette::Extractors::YamlExtractor::RailsExtractor

Class Method Summary collapse

Methods inherited from Resolver

parse_id

Class Method Details

.resolve(extractor_id, namespace = Rosette::Extractors) ⇒ Class

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

Parameters:

  • extractor_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::Extractors)

    The namespace to look in.

Returns:

  • (Class)

    The identified class constant.


23
24
25
# File 'lib/rosette/core/resolvers/extractor_id.rb', line 23

def resolve(extractor_id, namespace = Rosette::Extractors)
  super
end