Sha256: c076ba89e6e17f9590302b76f28d47912fc596cab934ec370ba80ffe2790366d

Contents?: true

Size: 552 Bytes

Versions: 17

Compression:

Stored size: 552 Bytes

Contents

module Sunspot
  module Search
    class StatsFacet < FieldFacet
      attr_reader :field

      def initialize(field, data) #:nodoc:
        @field, @data = field, data
      end

      def rows(options = {})
        if options[:verified]
          verified_rows
        else
          @rows ||= @data.map do |value, data|
            StatsRow.new(data, self, @field.type.cast(value))
          end.sort_by { |row| row.value.to_s }
        end
      end

      def inspect
        "<Sunspot::Search::StatsFacet:#{@field}>"
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
sunspot-2.7.1 lib/sunspot/search/stats_facet.rb
sunspot-2.7.0 lib/sunspot/search/stats_facet.rb
sunspot-2.6.0 lib/sunspot/search/stats_facet.rb
sunspot-2.5.0 lib/sunspot/search/stats_facet.rb
sunspot-2.4.0 lib/sunspot/search/stats_facet.rb
sunspot-2.3.0 lib/sunspot/search/stats_facet.rb
sunspot-2.2.8 lib/sunspot/search/stats_facet.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/sunspot-2.2.7/lib/sunspot/search/stats_facet.rb
sunspot-2.2.7 lib/sunspot/search/stats_facet.rb
sunspot-2.2.6 lib/sunspot/search/stats_facet.rb
sunspot-2.2.5 lib/sunspot/search/stats_facet.rb
sunspot-2.2.4 lib/sunspot/search/stats_facet.rb
sunspot-2.2.3 lib/sunspot/search/stats_facet.rb
sunspot-2.2.2 lib/sunspot/search/stats_facet.rb
sunspot-2.2.1 lib/sunspot/search/stats_facet.rb
sunspot-2.2.0 lib/sunspot/search/stats_facet.rb
sunspot-2.1.1 lib/sunspot/search/stats_facet.rb