Class: Valkyrie::Persistence::Fedora::Persister::ModelConverter::InternalValkyrieID

Inherits:
MappedFedoraValue show all
Defined in:
lib/valkyrie/persistence/fedora/persister/model_converter.rb

Overview

Class mapping Property objects for Valkyrie IDs which have not been mapped to Fedora LDP URIs

Instance Attribute Summary

Attributes inherited from ValueMapper

#calling_mapper, #value

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ValueMapper

for, #initialize, register

Constructor Details

This class inherits a constructor from Valkyrie::ValueMapper

Class Method Details

.handles?(value) ⇒ Boolean

Determines whether or not the value is a Property for Valkyrie ID which is not contain an adapter resource path URI

Parameters:

  • value (Object)

Returns:

  • (Boolean)


377
378
379
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 377

def self.handles?(value)
  value.is_a?(Property) && value.value.is_a?(Valkyrie::ID) && !value.value.to_s.include?("://")
end

Instance Method Details

#resultValkyrie::Persistence::Fedora::Persister::ModelConverter::Property

Generates the Property for this URI For example, a Valkyrie::ID with the value “c0831f2e-f86b-4d4a-9331-020b7418b068”

will first be mapped to <http://localhost:8988/rest/test_fed/c0/83/1f/2e/c0831f2e-f86b-4d4a-9331-020b7418b068>


385
386
387
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 385

def result
  map_value(converted_value: value.adapter.id_to_uri(value.value))
end