Class: MarkLogic::Queries::AndQuery

Inherits:
BaseQuery
  • Object
show all
Defined in:
lib/marklogic/queries/and_query.rb

Instance Method Summary collapse

Methods inherited from BaseQuery

#add_sub_query, #query_value

Constructor Details

#initialize(*args) ⇒ AndQuery

Returns a new instance of AndQuery.


4
5
6
# File 'lib/marklogic/queries/and_query.rb', line 4

def initialize(*args)
  @queries = args.flat_map{ |i| i }
end

Instance Method Details

#to_xqyObject


8
9
10
11
# File 'lib/marklogic/queries/and_query.rb', line 8

def to_xqy
  sub_queries = @queries.map { |q| q.to_xqy }.join(',')
  %Q{cts:and-query((#{sub_queries}))}
end