Sha256: d6b80ac5819f91cc08be955c371dacc4484df733d1e782e8d6395db2f742f8ed

Contents?: true

Size: 390 Bytes

Versions: 4

Compression:

Stored size: 390 Bytes

Contents

# frozen_string_literal: true

require "httparty"

# BlacklightApiFacets
class BlacklightApiFacets
  include HTTParty

  def initialize(request)
    @request = request
  end

  def fetch
    @fetch ||= self.class.get("#{@request}#{BLACKLIGHT_JSON_API_FACETS}", query: {})
  end

  def facets
    fetch["included"].select { |s| s["type"] == "facet" } if fetch["included"].present?
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
geoblacklight_admin-0.6.0 app/models/blacklight_api_facets.rb
geoblacklight_admin-0.5.1 app/models/blacklight_api_facets.rb
geoblacklight_admin-0.5.0 app/models/blacklight_api_facets.rb
geoblacklight_admin-0.4.2 app/models/blacklight_api_facets.rb