Class: Valkyrie::Persistence::Solr::ORMConverter::FloatValue
- Inherits:
-
ValueMapper
- Object
- ValueMapper
- Valkyrie::Persistence::Solr::ORMConverter::FloatValue
- Defined in:
- lib/valkyrie/persistence/solr/orm_converter.rb
Overview
Converts a float in solr into a Float
Instance Attribute Summary
Attributes inherited from ValueMapper
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from ValueMapper
Constructor Details
This class inherits a constructor from Valkyrie::ValueMapper
Class Method Details
.handles?(value) ⇒ Boolean
429 430 431 |
# File 'lib/valkyrie/persistence/solr/orm_converter.rb', line 429 def self.handles?(value) value.to_s.start_with?("float-") end |
Instance Method Details
#result ⇒ Object
433 434 435 |
# File 'lib/valkyrie/persistence/solr/orm_converter.rb', line 433 def result value.sub(/^float-/, '').to_f end |