Class: Valkyrie::Persistence::Fedora::Persister::ModelConverter::BooleanValue
- Inherits:
-
MappedFedoraValue
- Object
- ValueMapper
- MappedFedoraValue
- Valkyrie::Persistence::Fedora::Persister::ModelConverter::BooleanValue
- Defined in:
- lib/valkyrie/persistence/fedora/persister/model_converter.rb
Overview
Class for mapping Property objects for Boolean values
Instance Attribute Summary
Attributes inherited from ValueMapper
Class Method Summary collapse
-
.handles?(value) ⇒ Boolean
Determines whether or not the value is a Property for boolean values.
Instance Method Summary collapse
-
#result ⇒ Valkyrie::Persistence::Fedora::Persister::ModelConverter::Property
Generates the Property for this boolean RDF::Literal::Boolean:0x3fc310fdf120(“false”^^<example.com/predicate/valkyrie_bool>).
Methods inherited from ValueMapper
Constructor Details
This class inherits a constructor from Valkyrie::ValueMapper
Class Method Details
.handles?(value) ⇒ Boolean
Determines whether or not the value is a Property for boolean values
397 398 399 |
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 397 def self.handles?(value) value.is_a?(Property) && ([true, false].include? value.value) end |
Instance Method Details
#result ⇒ Valkyrie::Persistence::Fedora::Persister::ModelConverter::Property
Generates the Property for this boolean RDF::Literal::Boolean:0x3fc310fdf120(“false”^^<example.com/predicate/valkyrie_bool>)
404 405 406 407 408 409 |
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 404 def result map_value(converted_value: RDF::Literal.new( value.value, datatype: PermissiveSchema.valkyrie_bool )) end |