Method: Sunspot::FacetData::Abstract#cast

Defined in:
lib/sunspot/facet_data.rb

#cast(value) ⇒ Object

Cast the given value to the field’s type, if it has one; otherwise just return the string.



27
28
29
30
31
32
33
# File 'lib/sunspot/facet_data.rb', line 27

def cast(value)
  if @field
    @field.cast(value)
  else
    value
  end
end