Class: XTF::Search::Element::Or
- Defined in:
- lib/xtf/search/element/or.rb
Constant Summary
Constants inherited from Clause
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Clause
#content, #section_type, #term
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(*args) ⇒ Or
constructor
A new instance of Or.
Methods inherited from Clause
Methods inherited from Base
Constructor Details
#initialize(*args) ⇒ Or
Returns a new instance of Or.
4 5 6 7 8 9 10 11 |
# File 'lib/xtf/search/element/or.rb', line 4 def initialize(*args) @tag_name = "or" params = args[0] || {} raise ArgumentError, "Provide :field or :fields, but not both" if params.key?(:field) && params.key?(:fields) raise ArgumentError, ":fields requires :slop" if params.key?(:fields) && !params.key?(:slop) raise ArgumentError, ":slop requires :fields" if params.key?(:slop) && !params.key?(:fields) super end |