Class: Valkyrie::Persistence::Fedora::Persister::OrmConverter::GraphToAttributes::InternalModelValue

Inherits:
ValueMapper
  • Object
show all
Defined in:
lib/valkyrie/persistence/fedora/persister/orm_converter.rb

Overview

Casts the value of the RDF statements encoding the type of Valkyrie Resource into the resource type

Returns:

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 Property RDF statement refers to a resource type

Parameters:

Returns:

  • (Boolean)


450
451
452
# File 'lib/valkyrie/persistence/fedora/persister/orm_converter.rb', line 450

def self.handles?(value)
  value.statement.predicate == value.adapter.schema.predicate_for(property: :internal_resource, resource: nil)
end

Instance Method Details

#resultSingleApplicator

Constructs a SingleApplicator object for mapping the resource type

Returns:



456
457
458
# File 'lib/valkyrie/persistence/fedora/persister/orm_converter.rb', line 456

def result
  SingleApplicator.new(value)
end