Class: Para::Search::Distinct

Inherits:
Object
  • Object
show all
Defined in:
lib/para/search/distinct.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(search) ⇒ Distinct

Returns a new instance of Distinct.



13
14
15
16
# File 'lib/para/search/distinct.rb', line 13

def initialize(search)
  @search = search
  @sort_index ||= 0
end

Instance Attribute Details

#searchObject (readonly)

Returns the value of attribute search.



11
12
13
# File 'lib/para/search/distinct.rb', line 11

def search
  @search
end

Instance Method Details

#resultObject



18
19
20
21
# File 'lib/para/search/distinct.rb', line 18

def result
  selects = build_selects
  search.result.select(selects).distinct
end