Class: Valkyrie::Persistence::Fedora::Persister::ModelConverter::FloatValue

Inherits:
MappedFedoraValue show all
Defined in:
lib/valkyrie/persistence/fedora/persister/model_converter.rb

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)


436
437
438
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 436

def self.handles?(value)
  value.is_a?(Property) && value.value.is_a?(Float)
end

Instance Method Details

#resultObject



440
441
442
443
444
445
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 440

def result
  map_value(converted_value: RDF::Literal.new(
    value.value,
    datatype: PermissiveSchema.valkyrie_float
  ))
end