Module: Sunspot::Type::FloatType

Defined in:
lib/sunspot/type.rb

Overview

The Float type represents floating-point numbers.

Class Method Summary collapse

Class Method Details

.cast(string) ⇒ Object

:nodoc:



90
91
92
# File 'lib/sunspot/type.rb', line 90

def cast(string) #:nodoc:
  string.to_f
end

.indexed_name(name) ⇒ Object

:nodoc:



82
83
84
# File 'lib/sunspot/type.rb', line 82

def indexed_name(name) #:nodoc:
"#{name}_f"
end

.to_indexed(value) ⇒ Object

:nodoc:



86
87
88
# File 'lib/sunspot/type.rb', line 86

def to_indexed(value) #:nodoc:
  value.to_f.to_s if value
end