Class: Pubid::Export::FlavorExporter

Inherits:
Object
  • Object
show all
Defined in:
lib/pubid/export/flavor_exporter.rb

Overview

Abstract base class for per-flavor metadata extraction. Subclasses implement strategy for different Scheme patterns.

Open/Closed: New flavors add a subclass; no existing code changes. Single Responsibility: Each subclass extracts data for one Scheme pattern.

Constant Summary collapse

WRAPPER_CLASSES =

Wrapper classes to discover per flavor (overlay patterns that wrap base identifiers)

{
  iec: %i[VapIdentifier],
  bsi: %i[ValueAddedPublication],
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(flavor) ⇒ FlavorExporter

Returns a new instance of FlavorExporter.



21
22
23
# File 'lib/pubid/export/flavor_exporter.rb', line 21

def initialize(flavor)
  @flavor = flavor
end

Instance Attribute Details

#flavorObject (readonly)

Returns the value of attribute flavor.



13
14
15
# File 'lib/pubid/export/flavor_exporter.rb', line 13

def flavor
  @flavor
end

Instance Method Details

#exportObject

Subclasses must override

Raises:

  • (NotImplementedError)


26
27
28
# File 'lib/pubid/export/flavor_exporter.rb', line 26

def export
  raise NotImplementedError
end