Class: Ecfr::SearchService::FacetBase

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

Direct Known Subclasses

DateFacet, Timeline, 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
]

Class Method Summary collapse

Methods inherited from Base

base_url, service_name, service_path

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