Sha256: d82d590f13fa1ce8461ce1f3bc304d8fb11330c97884283ead9ea8eafb19c820

Contents?: true

Size: 472 Bytes

Versions: 51

Compression:

Stored size: 472 Bytes

Contents

# frozen_string_literal: true

module Renalware
  module Letters
    module Descriptions
      class SearchQuery
        attr_reader :term, :page, :per_page

        def initialize(term)
          @search_params = { text_cont: term }
          @search_params.reverse_merge!(s: "text asc")
        end

        def call
          search.result
        end

        def search
          @search ||= Description.search(@search_params)
        end
      end
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
renalware-core-2.0.64 app/models/renalware/letters/descriptions/search_query.rb
renalware-core-2.0.63 app/models/renalware/letters/descriptions/search_query.rb
renalware-core-2.0.62 app/models/renalware/letters/descriptions/search_query.rb
renalware-core-2.0.61 app/models/renalware/letters/descriptions/search_query.rb
renalware-core-2.0.60 app/models/renalware/letters/descriptions/search_query.rb
renalware-core-2.0.58 app/models/renalware/letters/descriptions/search_query.rb
renalware-core-2.0.57 app/models/renalware/letters/descriptions/search_query.rb
renalware-core-2.0.56 app/models/renalware/letters/descriptions/search_query.rb
renalware-core-2.0.55 app/models/renalware/letters/descriptions/search_query.rb
renalware-core-2.0.54 app/models/renalware/letters/descriptions/search_query.rb
renalware-core-2.0.53 app/models/renalware/letters/descriptions/search_query.rb
renalware-core-2.0.52 app/models/renalware/letters/descriptions/search_query.rb
renalware-core-2.0.51 app/models/renalware/letters/descriptions/search_query.rb
renalware-core-2.0.50 app/models/renalware/letters/descriptions/search_query.rb
renalware-core-2.0.48 app/models/renalware/letters/descriptions/search_query.rb
renalware-core-2.0.47 app/models/renalware/letters/descriptions/search_query.rb
renalware-core-2.0.46 app/models/renalware/letters/descriptions/search_query.rb
renalware-core-2.0.45 app/models/renalware/letters/descriptions/search_query.rb
renalware-core-2.0.44 app/models/renalware/letters/descriptions/search_query.rb
renalware-core-2.0.43 app/models/renalware/letters/descriptions/search_query.rb