Class: ROF::Ingesters::RelsExtIngester

Inherits:
Object
  • Object
show all
Defined in:
lib/rof/ingesters/rels_ext_ingester.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ RelsExtIngester

Returns a new instance of RelsExtIngester.



17
18
19
20
21
22
# File 'lib/rof/ingesters/rels_ext_ingester.rb', line 17

def initialize(attributes = {})
  @models = attributes.fetch(:models)
  @item = attributes.fetch(:item)
  @pid = item.fetch('pid')
  @fdoc = attributes.fetch(:fedora_document, nil)
end

Instance Attribute Details

#fdocObject (readonly)

:models is a list of fedora content models this item has :item is the hash of the ROF item :fdoc is an optional fedora document to save to :pid is the namespaced identifier of this item



16
17
18
# File 'lib/rof/ingesters/rels_ext_ingester.rb', line 16

def fdoc
  @fdoc
end

#itemObject (readonly)

:models is a list of fedora content models this item has :item is the hash of the ROF item :fdoc is an optional fedora document to save to :pid is the namespaced identifier of this item



16
17
18
# File 'lib/rof/ingesters/rels_ext_ingester.rb', line 16

def item
  @item
end

#modelsObject (readonly)

:models is a list of fedora content models this item has :item is the hash of the ROF item :fdoc is an optional fedora document to save to :pid is the namespaced identifier of this item



16
17
18
# File 'lib/rof/ingesters/rels_ext_ingester.rb', line 16

def models
  @models
end

#pidObject (readonly)

:models is a list of fedora content models this item has :item is the hash of the ROF item :fdoc is an optional fedora document to save to :pid is the namespaced identifier of this item



16
17
18
# File 'lib/rof/ingesters/rels_ext_ingester.rb', line 16

def pid
  @pid
end

Class Method Details

.call(attributes) ⇒ Object



8
9
10
# File 'lib/rof/ingesters/rels_ext_ingester.rb', line 8

def self.call(attributes)
  new(attributes).call
end

Instance Method Details

#callObject



24
25
26
27
28
# File 'lib/rof/ingesters/rels_ext_ingester.rb', line 24

def call
  content = build_content
  persist(content)
  content
end