class Ddr::Index::Query
Public Class Methods
new(**args, &block)
click to toggle source
Calls superclass method
# File lib/ddr/index/query.rb, line 19 def initialize(**args, &block) super(**args) if block_given? build(&block) end end
Public Instance Methods
==(other)
click to toggle source
# File lib/ddr/index/query.rb, line 66 def ==(other) other.instance_of?(self.class) && other.q == self.q && other.fields == self.fields && other.filters == self.filters && other.rows == self.rows && other.sort == self.sort end
build(&block)
click to toggle source
# File lib/ddr/index/query.rb, line 61 def build(&block) QueryBuilder.new(self, &block) self end
csv()
click to toggle source
# File lib/ddr/index/query.rb, line 49 def csv CSVQueryResult.new(self) end
each_pid(&block)
click to toggle source
# File lib/ddr/index/query.rb, line 40 def each_pid(&block) Deprecation.warn(QueryResult, "`each_pid` is deprecated; use `each_id` instead.") each_id(&block) end
filter_clauses()
click to toggle source
# File lib/ddr/index/query.rb, line 53 def filter_clauses filters.map(&:clauses).flatten end
inspect()
click to toggle source
# File lib/ddr/index/query.rb, line 26 def inspect "#<#{self.class.name} q=#{q.inspect}, filters=#{filters.inspect}," \ " sort=#{sort.inspect}, rows=#{rows.inspect}, fields=#{fields.inspect}>" end
pids()
click to toggle source
# File lib/ddr/index/query.rb, line 35 def pids Deprecation.warn(QueryResult, "`pids` is deprecated; use `ids` instead.") ids end
query_params()
click to toggle source
# File lib/ddr/index/query.rb, line 57 def query_params QueryParams.new(self) end
result()
click to toggle source
# File lib/ddr/index/query.rb, line 45 def result QueryResult.new(self) end
to_s()
click to toggle source
# File lib/ddr/index/query.rb, line 31 def to_s URI.encode_www_form(params) end