Class: Ecfr::AdminService::Agency

Inherits:
Base show all
Defined in:
lib/ecfr/admin_service/agency.rb

Constant Summary collapse

AGENCIES_PATH =
"v1/agencies.json"

Constants inherited from Base

Base::SUPPORTED_ARRAY_ACCESSORS

Instance Attribute Summary collapse

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 Ecfr::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

Instance Attribute Details

#cfr_references[Ecfr::Common::Hierarchy] (readonly)

portions of the CFR this agency is responsible for, expected keys are only :title, :subtitle, :chapter, :subchapter, and :part



12
13
14
15
# File 'lib/ecfr/admin_service/agency.rb', line 12

attribute :cfr_references, type: Array(Ecfr::Common::Hierarchy),
        desc: "portions of the CFR this agency is responsible for,
expected keys are only :title, :subtitle, :chapter,
:subchapter, and :part"

#children[Agency] (readonly)

sub-agencies of the current agency

Returns:



17
18
# File 'lib/ecfr/admin_service/agency.rb', line 17

attribute :children, type: Array(Agency),
desc: "sub-agencies of the current agency"

#display_nameString (readonly)

official name of agency, including parent (if any)

Returns:

  • (String)


6
# File 'lib/ecfr/admin_service/agency.rb', line 6

attribute :display_name, desc: "official name of agency, including parent (if any)"

#nameString (readonly)

official name of agency

Returns:

  • (String)


7
# File 'lib/ecfr/admin_service/agency.rb', line 7

attribute :name, desc: "official name of agency"

#short_nameString (readonly)

agency acronym

Returns:

  • (String)


8
# File 'lib/ecfr/admin_service/agency.rb', line 8

attribute :short_name, desc: "agency acronym"

#slugString (readonly)

normalized, unique agency identifier in the eCFR system

Returns:

  • (String)


9
# File 'lib/ecfr/admin_service/agency.rb', line 9

attribute :slug, desc: "normalized, unique agency identifier in the eCFR system"

#sortable_nameString (readonly)

sortable version of agency name

Returns:

  • (String)


10
# File 'lib/ecfr/admin_service/agency.rb', line 10

attribute :sortable_name, desc: "sortable version of agency name"

Class Method Details

.all[<Agency>]

Retrieve the list of all agencies, their subagencies and the portions of the CFR they are responsible for

Returns:

  • ([<Agency>])

    an array of agency records



28
29
30
31
32
33
# File 'lib/ecfr/admin_service/agency.rb', line 28

def self.all
  perform(
    :get,
    AGENCIES_PATH
  )
end