Class: Hyrax::Ingest::Fetcher::PremisEventType

Inherits:
Base
  • Object
show all
Defined in:
lib/hyrax/ingest/fetcher/premis_event_type.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#required?

Methods included from HasLogger

config, #logger, #logger=

Methods included from HasReport

#report, #report=

Constructor Details

#initialize(options = {}) ⇒ PremisEventType

Returns a new instance of PremisEventType.



16
17
18
19
20
# File 'lib/hyrax/ingest/fetcher/premis_event_type.rb', line 16

def initialize(options={})
  options = { abbr: options } unless options.is_a? Hash
  @abbr = options.delete(:abbr)
  super
end

Instance Attribute Details

#abbrObject (readonly)

Returns the value of attribute abbr.



14
15
16
# File 'lib/hyrax/ingest/fetcher/premis_event_type.rb', line 14

def abbr
  @abbr
end

Instance Method Details

#fetchObject



22
23
24
# File 'lib/hyrax/ingest/fetcher/premis_event_type.rb', line 22

def fetch
  @fetched_value ||= Hyrax::Preservation::PremisEventType.find_by_abbr(@abbr).uri
end