Class: Sunspot::Restriction::SameAs
- Defined in:
- lib/sunspot/restriction.rb
Overview
Result must be the exact instance given (only useful when negated).
Instance Method Summary collapse
-
#initialize(object, negative = false) ⇒ SameAs
constructor
A new instance of SameAs.
- #to_positive_boolean_phrase ⇒ Object
Methods inherited from Base
#to_boolean_phrase, #to_negative_boolean_phrase, #to_params
Constructor Details
#initialize(object, negative = false) ⇒ SameAs
Returns a new instance of SameAs.
206 207 208 |
# File 'lib/sunspot/restriction.rb', line 206 def initialize(object, negative = false) @object, @negative = object, negative end |
Instance Method Details
#to_positive_boolean_phrase ⇒ Object
210 211 212 213 |
# File 'lib/sunspot/restriction.rb', line 210 def to_positive_boolean_phrase adapter = Adapters::InstanceAdapter.adapt(@object) "id:#{Solr::Util.query_parser_escape(adapter.index_id)}" end |