Module: Sunspot::Type::BooleanType
- Defined in:
- lib/sunspot/type.rb
Overview
The boolean type represents true/false values. Note that nil will not be indexed at all; only false will be indexed with a false value.
Class Method Summary collapse
Class Method Details
.cast(string) ⇒ Object
135 136 137 138 139 140 141 142 |
# File 'lib/sunspot/type.rb', line 135 def cast(string) case string when 'true' true when 'false' false end end |
.indexed_name(name) ⇒ Object
125 126 127 |
# File 'lib/sunspot/type.rb', line 125 def indexed_name(name) "#{name}_b" end |
.to_indexed(value) ⇒ Object
129 130 131 132 133 |
# File 'lib/sunspot/type.rb', line 129 def to_indexed(value) unless value.nil? value ? 'true' : 'false' end end |