Class: Sunspot::Type::IntegerType

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

Overview

The Integer type represents integers.

Direct Known Subclasses

LongType, TrieIntegerType

Instance Method Summary collapse

Methods inherited from AbstractType

#accepts_dynamic?, #accepts_more_like_this?

Instance Method Details

#cast(string) ⇒ Object

:nodoc:



149
150
151
# File 'lib/sunspot/type.rb', line 149

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

#indexed_name(name) ⇒ Object

:nodoc:



137
138
139
# File 'lib/sunspot/type.rb', line 137

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

#to_indexed(value) ⇒ Object

:nodoc:



141
142
143
# File 'lib/sunspot/type.rb', line 141

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

#to_literal(value) ⇒ Object



145
146
147
# File 'lib/sunspot/type.rb', line 145

def to_literal(value)
  to_indexed(value)
end