module Exlibris::Primo::WebService::Request::QueryTerms

Attributes

boolean_operator[W]

Public Instance Methods

add_query_term(value, index, precision="contains") click to toggle source
# File lib/exlibris/primo/web_service/request/search/query_terms.rb, line 33
def add_query_term(value, index, precision="contains")
  query_terms << QueryTerm.new(:value => value, :index => index, :precision => precision)
end
boolean_operator() click to toggle source
# File lib/exlibris/primo/web_service/request/search/query_terms.rb, line 8
def boolean_operator
  @boolean_operator ||= "AND"
end
query_terms() click to toggle source
# File lib/exlibris/primo/web_service/request/search/query_terms.rb, line 29
def query_terms
  @query_terms ||= []
end

Protected Instance Methods

query_terms_xml() click to toggle source

Returns a lambda that takes a Nokogiri::XML::Builder as an argument and appends query terms XML to it.

# File lib/exlibris/primo/web_service/request/search/query_terms.rb, line 16
def query_terms_xml
  bool_operator = boolean_operator
  lambda do |xml|
    xml.QueryTerms {
      xml.BoolOpeator bool_operator
      query_terms.each do |query_term|
        xml << query_term.to_xml
      end
    }
  end
end