Class: Valkyrie::Persistence::Solr::ORMConverter::NestedResourceID

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

Overview

Class for handling serialized Hashes for Valkyrie IDs in Solr fields

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 an Object is a Property

Parameters:

  • value (Object)

Returns:

  • (Boolean)


315
316
317
# File 'lib/valkyrie/persistence/solr/orm_converter.rb', line 315

def self.handles?(value)
  value.is_a?(Hash) && value[:id] && !value[:internal_resource]
end

Instance Method Details

#resultValkyrie::ID

Constructs a Valkyrie::ID object using the value keyed to :id in the Property Hash value

Returns:



321
322
323
# File 'lib/valkyrie/persistence/solr/orm_converter.rb', line 321

def result
  Valkyrie::ID.new(value[:id])
end