Class: FederalRegister::SuggestedSearch

Inherits:
Base
  • Object
show all
Defined in:
lib/federal_register/suggested_search.rb

Constant Summary

Constants inherited from Base

Base::INTEGER_CLASS

Instance Attribute Summary

Attributes inherited from Base

#attributes

Class Method Summary collapse

Methods inherited from Base

add_attribute, #fetch_full, #full?, #initialize, override_base_uri

Methods inherited from Client

get

Constructor Details

This class inherits a constructor from FederalRegister::Base

Class Method Details

.find(slug) ⇒ Object



22
23
24
25
# File 'lib/federal_register/suggested_search.rb', line 22

def self.find(slug)
  response = get("/suggested_searches/#{URI.encode(slug.to_s)}").parsed_response
  new(response)
end

.search(args = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/federal_register/suggested_search.rb', line 11

def self.search(args={})
  response = get('/suggested_searches', query: args).parsed_response

  responses = {}
  response.map do |section, searches|
    responses[section] = searches.map{|attributes| new(attributes)}
  end

  responses
end