Class: Ecfr::SearchService::FacetBase

Inherits:
Base show all
Defined in:
lib/ecfr/search_service/facet_base.rb

Direct Known Subclasses

DateFacet, TitleFacet

Constant Summary collapse

COUNTS_PATH =
"v1/counts"
VALID_SEARCH_OPTIONS =
%i[
  hierarchy last_modified_after last_modified_on_or_after
  last_modified_before last_modified_on_or_before query reserved
  substantive
]

Constants inherited from Base

Base::SUPPORTED_ARRAY_ACCESSORS

Instance Attribute Summary

Attributes inherited from Base

#metadata, #request_data, #response_status, #results

Class Method Summary collapse

Methods inherited from Base

base_url, service_name, service_path

Methods inherited from Base

basic_auth_client_options, #each, #initialize, metadata, metadata_key, result_key

Methods included from Extensible

#inherited

Methods included from AttributeMethodDefinition

included, #initialize

Methods inherited from Client

build, cache_key, client, client_pool, delete, execute, get, handle_response, perform, post, purge

Methods included from ParallelClient

included

Constructor Details

This class inherits a constructor from Ecfr::Base

Class Method Details

.search(type, args = {}) ⇒ <DateFacet>

Retrive counts of changed CFR sections by date

Parameters:

  • args (<Hash>) (defaults to: {})

    valid facet search parameters

  • options (Hash)

    a customizable set of options

Returns:



21
22
23
24
25
26
27
28
29
# File 'lib/ecfr/search_service/facet_base.rb', line 21

def self.search(type, args = {})
  prepare_search_options(args)

  perform(
    :get,
    counts_path(type),
    params: args
  )
end