Class: Valkyrie::Persistence::Solr::ORMConverter::BooleanValue
- Inherits:
-
ValueMapper
- Object
- ValueMapper
- Valkyrie::Persistence::Solr::ORMConverter::BooleanValue
- Defined in:
- lib/valkyrie/persistence/solr/orm_converter.rb
Overview
Converts an boolean in solr into an Boolean
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
238 239 240 |
# File 'lib/valkyrie/persistence/solr/orm_converter.rb', line 238 def self.handles?(value) value.to_s.start_with?("boolean-") end |
Instance Method Details
#result ⇒ Object
242 243 244 245 |
# File 'lib/valkyrie/persistence/solr/orm_converter.rb', line 242 def result val = value.sub(/^boolean-/, '') val.casecmp("true").zero? end |