Class: Valkyrie::Persistence::Solr::ORMConverter::NestedResourceValue
- Inherits:
-
ValueMapper
- Object
- ValueMapper
- Valkyrie::Persistence::Solr::ORMConverter::NestedResourceValue
show all
- Defined in:
- lib/valkyrie/persistence/solr/orm_converter.rb
Overview
Converts a nested resource in solr into a Resource
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
Class Method Details
.handles?(value) ⇒ Boolean
158
159
160
|
# File 'lib/valkyrie/persistence/solr/orm_converter.rb', line 158
def self.handles?(value)
value.to_s.start_with?("serialized-")
end
|
Instance Method Details
#json ⇒ Object
166
167
168
|
# File 'lib/valkyrie/persistence/solr/orm_converter.rb', line 166
def json
value.sub(/^serialized-/, '')
end
|
#result ⇒ Object
162
163
164
|
# File 'lib/valkyrie/persistence/solr/orm_converter.rb', line 162
def result
NestedResourceConverter.for(JSON.parse(json, symbolize_names: true)).result
end
|