Sha256: f9e5a7f1c1f250ba1f847f83f91fe2e38a3df4cf2d36862c26036e733d2c1a48
Contents?: true
Size: 695 Bytes
Versions: 46
Compression:
Stored size: 695 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.ransack(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
46 entries across 46 versions & 1 rubygems