class NewspaperWorks::Ingest::PublicationInfo

Attributes

implementation[RW]
lccn[RW]

Public Class Methods

new(lccn) click to toggle source
# File lib/newspaper_works/ingest/publication_info.rb, line 10
def initialize(lccn)
  @lccn = lccn
  @implementation = nil
  load
end

Public Instance Methods

load() click to toggle source
# File lib/newspaper_works/ingest/publication_info.rb, line 20
def load
  @implementation = LCPublicationInfo.new(@lccn)
  @implementation.load
  # Empty mods is equivalent to 404 for LCCN in LC Catalog:
  load_chronam_fallback if @implementation.empty?
end
load_chronam_fallback() click to toggle source
# File lib/newspaper_works/ingest/publication_info.rb, line 16
def load_chronam_fallback
  @implementation = ChronAmPublicationInfo.new(@lccn)
end
method_missing(method, *args, &block) click to toggle source
Calls superclass method
# File lib/newspaper_works/ingest/publication_info.rb, line 31
def method_missing(method, *args, &block)
  # proxy call to underlying implementation:
  if respond_to_missing?(method)
    return @implementation.send(
      method,
      *args,
      &block
    )
  end
  super
end
respond_to_missing?(symbol, include_priv = false) click to toggle source
# File lib/newspaper_works/ingest/publication_info.rb, line 27
def respond_to_missing?(symbol, include_priv = false)
  @implementation.respond_to?(symbol, include_priv)
end