Class: XTF::Search::Element::And
- Defined in:
- lib/xtf/search/element/and.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) ⇒ And
constructor
A new instance of And.
Methods inherited from Clause
Methods inherited from Base
Constructor Details
#initialize(*args) ⇒ And
Returns a new instance of And.
4 5 6 7 8 9 10 11 |
# File 'lib/xtf/search/element/and.rb', line 4 def initialize(*args) @tag_name = "and" 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 |