Class: Valkyrie::Persistence::Solr::ORMConverter::IDValue

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

Overview

Converts a stored ID value in solr into a ID

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

Returns:

  • (Boolean)


134
135
136
# File 'lib/valkyrie/persistence/solr/orm_converter.rb', line 134

def self.handles?(value)
  value.to_s.start_with?("id-")
end

Instance Method Details

#resultObject



138
139
140
# File 'lib/valkyrie/persistence/solr/orm_converter.rb', line 138

def result
  Valkyrie::ID.new(value.sub(/^id-/, ''))
end