Module: CDMDEXER

Defined in:
lib/cdmdexer/formatters.rb,
lib/cdmdexer/hooks.rb,
lib/cdmdexer/loader.rb,
lib/cdmdexer/version.rb,
lib/cdmdexer/cdm_item.rb,
lib/cdmdexer/rake_task.rb,
lib/cdmdexer/etl_worker.rb,
lib/cdmdexer/oai_client.rb,
lib/cdmdexer/load_worker.rb,
lib/cdmdexer/oai_request.rb,
lib/cdmdexer/transformer.rb,
lib/cdmdexer/default_solr.rb,
lib/cdmdexer/field_mapping.rb,
lib/cdmdexer/field_formatter.rb,
lib/cdmdexer/etl_by_set_specs.rb,
lib/cdmdexer/transform_worker.rb,
lib/cdmdexer/default_cdm_error.rb,
lib/cdmdexer/field_transformer.rb,
lib/cdmdexer/filtered_set_specs.rb,
lib/cdmdexer/record_transformer.rb,
lib/cdmdexer/regex_filter_callback.rb,
lib/cdmdexer/default_cdm_notification.rb,
lib/cdmdexer/default_oai_notification.rb,
lib/cdmdexer/default_completed_callback.rb,
lib/cdmdexer/default_loader_notification.rb,
lib/cdmdexer/transformation_error_message.rb

Overview

A handful of very simple formatters to clean up CONTENTdm API metadata

Defined Under Namespace

Modules: DefaultFilterSetCallback, RakeTask Classes: AddSetSpecFormatter, CdmItem, CollectionDescriptionFormatter, CollectionNameFormatter, DefaultCdmError, DefaultCdmNotification, DefaultCompletedCallback, DefaultFormatter, DefaultLoaderNotification, DefaultOaiNotification, DefaultSolr, ETLBySetSpecs, ETLWorker, FieldFormatter, FieldMapping, FieldTransformer, FilterBadCollections, FilteredSetSpecs, GeoNameID, GeoNameIDToJson, GeoNameToLocation, GeoNameToPlaceName, ImageId, JoinFormatter, KeywordFormatter, LoadWorker, Loader, LocationFormatter, OaiClient, OaiRequest, RecordTransformer, RegexFilterCallback, SetSpecFormatter, SplitFormatter, StripFormatter, StripSemicolonFormatter, Titlieze, ToIFormatter, ToJsonFormatter, TransformWorker, TransformationErrorMessage, Transformer, UniqueFormatter

Constant Summary collapse

VERSION =
"0.22.0"

Class Method Summary collapse

Class Method Details

.const_missing(name) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/cdmdexer/hooks.rb', line 2

def self.const_missing(name)
  if name.to_s == 'Solr'
    hook(pattern: name.to_s, default: DefaultSolr)
  elsif name.to_s == 'CompletedCallback'
    hook(pattern: name.to_s, default: DefaultCompletedCallback)
  elsif name.to_s == 'OaiNotification'
    hook(pattern: name.to_s, default: DefaultOaiNotification)
  elsif name.to_s == 'LoaderNotification'
    hook(pattern: name.to_s, default: DefaultLoaderNotification)
  elsif name.to_s == 'CdmNotification'
    hook(pattern: name.to_s, default: DefaultCdmNotification)
  elsif name.to_s == 'CdmError'
    hook(pattern: name.to_s, default: DefaultCdmError)
  end
end

.find_hook(pattern, default) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/cdmdexer/hooks.rb', line 26

def self.find_hook(pattern, default)
  CDMDEXER.constants.find do |konst|
    if Object.const_get("CDMDEXER::#{konst}") != default
      /#{pattern}/ =~ konst.to_s
    end
  end
end

.hook(pattern: '', default: false) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/cdmdexer/hooks.rb', line 18

def self.hook(pattern: '', default: false)
  if find_hook(pattern, default)
    Object.const_get("CDMDEXER::#{find_hook(pattern, default)}")
  else
    default
  end
end