Class: Sunspot::Type::FloatType

Inherits:
AbstractType show all
Defined in:
sunspot/lib/sunspot/type.rb

Overview

The Float type represents floating-point numbers.

Direct Known Subclasses

DoubleType, TrieFloatType

Instance Method Summary (collapse)

Methods inherited from AbstractType

#accepts_dynamic?, #accepts_more_like_this?

Instance Method Details

- (Object) cast(string)

:nodoc:



180
181
182
# File 'sunspot/lib/sunspot/type.rb', line 180

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

- (Object) indexed_name(name)

:nodoc:



168
169
170
# File 'sunspot/lib/sunspot/type.rb', line 168

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

- (Object) to_indexed(value)

:nodoc:



172
173
174
# File 'sunspot/lib/sunspot/type.rb', line 172

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

- (Object) to_literal(value)



176
177
178
# File 'sunspot/lib/sunspot/type.rb', line 176

def to_literal(value)
  to_indexed(value)
end