Class: MarkLogic::Queries::DirectoryQuery

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

Instance Method Summary collapse

Methods inherited from BaseQuery

#add_sub_query, #query_value

Constructor Details

#initialize(uris, depth = nil) ⇒ DirectoryQuery

Returns a new instance of DirectoryQuery.


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

def initialize(uris, depth = nil)
  @directory_uris = uris
  @depth = depth
end

Instance Method Details

#to_xqyObject


9
10
11
12
13
14
15
16
17
# File 'lib/marklogic/queries/directory_query.rb', line 9

def to_xqy
  uris = query_value(@directory_uris)

  if @depth.nil?
    %Q{cts:directory-query((#{uris}))}
  else
    %Q{cts:directory-query((#{uris}),"#{@depth}")}
  end
end