Sha256: 7498892a50f463d955b3e9a411a226bbdeb47052bfca306b06ebf23d2b78fc35
Contents?: true
Size: 694 Bytes
Versions: 51
Compression:
Stored size: 694 Bytes
Contents
# frozen_string_literal: true require_dependency "renalware/renal" module Renalware module Renal module PRDDescriptions class SearchQuery attr_reader :term, :page, :per_page def initialize(term:, page: 1, per_page: 50) @term = term @page = page @per_page = per_page end def call search.result.page(page).per(per_page).select(fields) end private def search @search ||= PRDDescription.search(term_or_code_cont: term).tap do |s| s.sorts = ["term"] end end def fields %i(id code term) end end end end end
Version data entries
51 entries across 51 versions & 1 rubygems