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

Instance Method Details

#cast(string) ⇒ Object

:nodoc:



147
148
149
# File 'lib/sunspot/type.rb', line 147

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

#indexed_name(name) ⇒ Object

:nodoc:



135
136
137
# File 'lib/sunspot/type.rb', line 135

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

#to_indexed(value) ⇒ Object

:nodoc:



139
140
141
# File 'lib/sunspot/type.rb', line 139

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

#to_literal(value) ⇒ Object



143
144
145
# File 'lib/sunspot/type.rb', line 143

def to_literal(value)
  to_indexed(value)
end