Class: Wings::ResourceMapper
- Inherits:
-
Valkyrie::ValueMapper
- Object
- Valkyrie::ValueMapper
- Wings::ResourceMapper
- Defined in:
- lib/wings/transformer_value_mapper.rb
Overview
Maps ‘RDF::Term` values to their underlying types.
Most importantly, this handles cases where a complex model implementing ‘RDF::Term` (e.g. an `ActiveFedora::Base` or `ActiveTriples::RDFSource`) is included as a value, casting it to an `RDF::URI` or `RDF::Node` which can be handled by `Valkyrie`.
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.handles?(value) ⇒ Boolean
47 48 49 |
# File 'lib/wings/transformer_value_mapper.rb', line 47 def self.handles?(value) value.respond_to?(:term?) && value.term? end |
Instance Method Details
#result ⇒ RDF::Term
53 54 55 |
# File 'lib/wings/transformer_value_mapper.rb', line 53 def result value.to_term end |