Class: Para::Search::Distinct
- Inherits:
-
Object
- Object
- Para::Search::Distinct
- Defined in:
- lib/para/search/distinct.rb
Instance Attribute Summary collapse
-
#search ⇒ Object
readonly
Returns the value of attribute search.
Instance Method Summary collapse
-
#initialize(search) ⇒ Distinct
constructor
A new instance of Distinct.
- #result ⇒ Object
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
#search ⇒ Object (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
#result ⇒ Object
18 19 20 21 |
# File 'lib/para/search/distinct.rb', line 18 def result selects = build_selects search.result.select(selects).distinct end |