Class: Emendate::Translators::Abstract
- Inherits:
-
Object
- Object
- Emendate::Translators::Abstract
- Defined in:
- lib/emendate/translators/abstract.rb
Overview
Abstract class defining the interface common to all translators
Direct Known Subclasses
Collectionspace::Decade, Collectionspace::Error, Collectionspace::KnownUnknown, Collectionspace::Range, Collectionspace::Untokenizable, Collectionspace::Year, Collectionspace::YearMonth, Collectionspace::YearMonthDay, Collectionspace::YearSeason, Edtf::Century, Edtf::KnownUnknown, Edtf::Year, Edtf::YearMonth, Edtf::YearMonthDay, LyrasisPseudoEdtf::Century, LyrasisPseudoEdtf::KnownUnknown, LyrasisPseudoEdtf::Range, LyrasisPseudoEdtf::Year, LyrasisPseudoEdtf::YearMonth, LyrasisPseudoEdtf::YearMonthDay
Instance Method Summary collapse
Instance Method Details
#translate(processed, pdate) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/emendate/translators/abstract.rb', line 10 def translate(processed, pdate) @processed = processed @pdate = pdate @warnings = processed.warnings.flatten.uniq @base = nil @qualified = nil preprocess if respond_to?(:preprocess) translate_value TranslatedDate.new( orig: processed.orig_string, value: qualified || base, warnings: warnings ) end |