Class: Sunspot::Query::Connective::Disjunction

Inherits:
Abstract show all
Defined in:
lib/sunspot/query/connective.rb

Overview

Disjunctions combine their components with an OR operator.

Instance Method Summary collapse

Methods inherited from Abstract

#add_component, #initialize, #to_boolean_phrase, #to_params

Methods inherited from Scope

#add_disjunction, #add_negated_restriction, #add_negated_shorthand_restriction, #add_restriction, #add_shorthand_restriction, #dynamic_query, #exclude_instance

Constructor Details

This class inherits a constructor from Sunspot::Query::Connective::Abstract

Instance Method Details

#add_conjunctionObject

Add a conjunction to the disjunction. This overrides the method in the Scope class since scopes are implicitly conjunctive and thus can return themselves as a conjunction. Inside a disjunction, however, a conjunction must explicitly be created.



53
54
55
56
# File 'lib/sunspot/query/connective.rb', line 53

def add_conjunction
  @components << conjunction = Conjunction.new(setup)
  conjunction
end