class Sunspot::Type::DateRangeType

Public Instance Methods

cast(value) click to toggle source
Calls superclass method
# File lib/sunspot/type.rb, line 391
def cast(value)
  return super unless m = value.match(/^\[(?<start>.+) TO (?<end>.+)\]$/)
  Range.new super(m[:start]), super(m[:end])
end
indexed_name(name) click to toggle source
# File lib/sunspot/type.rb, line 379
def indexed_name(name)
  "#{name}_dr"
end
to_indexed(value) click to toggle source
Calls superclass method
# File lib/sunspot/type.rb, line 383
def to_indexed(value)
  if value.respond_to?(:first) && value.respond_to?(:last)
    "[#{super value.first} TO #{super value.last}]"
  else
    super value
  end
end