Class: FederalRegister::Facet::PublicInspectionIssue

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

Direct Known Subclasses

Daily, DailyFiling, Type, TypeFiling

Defined Under Namespace

Classes: Daily, DailyFiling, Type, TypeFiling

Constant Summary

Constants inherited from Base

Base::INTEGER_CLASS

Instance Attribute Summary collapse

Attributes inherited from Base

#attributes

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

add_attribute, #fetch_full, #full?, override_base_uri

Methods inherited from Client

get

Constructor Details

#initialize(attributes, options = {}) ⇒ PublicInspectionIssue

Returns a new instance of PublicInspectionIssue.



5
6
7
8
# File 'lib/federal_register/facet/public_inspection_issue.rb', line 5

def initialize(attributes, options = {})
  @conditions = options[:query] || {}
  super
end

Instance Attribute Details

#conditionsObject (readonly)

Returns the value of attribute conditions.



3
4
5
# File 'lib/federal_register/facet/public_inspection_issue.rb', line 3

def conditions
  @conditions
end

Class Method Details

.search(args = {}) ⇒ Object



28
29
30
31
32
33
34
35
# File 'lib/federal_register/facet/public_inspection_issue.rb', line 28

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

  response.map do |slug, attributes|
    attributes['slug'] = slug
    new(attributes, query: args)
  end
end

Instance Method Details

#regular_filingsObject



19
20
21
22
23
24
25
26
# File 'lib/federal_register/facet/public_inspection_issue.rb', line 19

def regular_filings
  @regular_filings ||= filing_class.new(
    attributes['regular_filings'],
    conditions.deep_merge({
      conditions: {special_filing: 0}
    })
  )
end

#special_filingsObject



10
11
12
13
14
15
16
17
# File 'lib/federal_register/facet/public_inspection_issue.rb', line 10

def special_filings
  @special_filings ||= filing_class.new(
    attributes['special_filings'],
    conditions.deep_merge({
      conditions: {special_filing: 1}
    })
  )
end