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

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 time of creation for the Valkyrie Resource into a DateTime value

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 encodes a creation date

Parameters:

Returns:

  • (Boolean)


475
476
477
# File 'lib/valkyrie/persistence/fedora/persister/orm_converter.rb', line 475

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

Instance Method Details

#resultNonStringSingleApplicator

Constructs a NonStringSingleApplicator object for mapping the resource creation time



481
482
483
# File 'lib/valkyrie/persistence/fedora/persister/orm_converter.rb', line 481

def result
  NonStringSingleApplicator.new(value)
end