Class: Sunspot::DateFacetRow

Inherits:
FacetRow show all
Defined in:
lib/sunspot/date_facet_row.rb

Overview

TODO document

Instance Method Summary collapse

Methods inherited from FacetRow

#count

Constructor Details

#initialize(pair, gap, facet) ⇒ DateFacetRow

Returns a new instance of DateFacetRow.



4
5
6
7
# File 'lib/sunspot/date_facet_row.rb', line 4

def initialize(pair, gap, facet)
  @gap = gap
  super(pair, facet)
end

Instance Method Details

#valueObject



9
10
11
12
13
14
15
# File 'lib/sunspot/date_facet_row.rb', line 9

def value
  @value ||=
    begin
      start_date = @facet.field.cast(@pair[0])
      Range.new(start_date, start_date + @gap)
    end
end