Class: FederalRegister::Section

Inherits:
Base show all
Defined in:
lib/federal_register/section.rb

Instance Attribute Summary

Attributes inherited from Base

#attributes

Class Method Summary collapse

Instance 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

.search(args = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/federal_register/section.rb', line 4

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

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

  responses
end

Instance Method Details

#highlighted_documentsObject



15
16
17
18
19
# File 'lib/federal_register/section.rb', line 15

def highlighted_documents
  @highlighted_documents ||= attributes['highlighted_documents'].map do |attributes|
    highlighted_document_class.new(attributes)
  end
end