Class: Ecfr::VersionerService::Title
- Extended by:
- ResponseHelper
- Defined in:
- lib/ecfr/versioner_service/title.rb,
lib/ecfr/testing/extensions/versioner_service/title_extenstions.rb
Overview
The titles API endpoint provides information about the status of each title and the overall system processing status.
At most times the up_to_date_as_of date will be the same for all titles. Only when the system import is in process (each evening) or if reprocessing is being performed will these dates differ.
If any title is currently importing or being reprocessed the processing_in_progress attribute will be set.
The lastest_amended_on indicates the last time the Title has a substantive change occur. The latest_issue_date is the most recent date that we received the title for processing. These two attributes will generally only differ when we receive non-sunstantive updates (changes to fix minor spelling, punctuation, etc.).
Constant Summary collapse
- TITLES_PATH =
"v1/titles"
Constants inherited from Base
Base::SUPPORTED_ARRAY_ACCESSORS
Instance Attribute Summary collapse
-
#date ⇒ Date
readonly
the max up to date value of all Titles.
-
#import_in_progress ⇒ Boolean
readonly
whether any Title is undergoing processing.
-
#latest_amended_on ⇒ Date
readonly
the most recent date that the Title has been amended on.
-
#latest_issue_date ⇒ Date
readonly
the most recent issue of the Title.
-
#name ⇒ String
readonly
name of Title.
-
#number ⇒ Integer
readonly
Title number.
-
#processing_in_progress ⇒ Boolean
readonly
whether the Title is currently being processed.
-
#reserved ⇒ Boolean
readonly
whether the Title is Reserved.
-
#up_to_date_as_of ⇒ Date
readonly
the date through which the Title considered curent.
Attributes inherited from Base
#metadata, #request_data, #response_status, #results
Class Method Summary collapse
-
.all(options = {}) ⇒ <Title>
Retreive the list of all Titles.
- .response_for(titles) ⇒ Object
Methods included from ResponseHelper
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
Methods included from AttributeMethodDefinition
Methods inherited from Client
build, cache_key, client, client_pool, delete, execute, get, handle_response, perform, post, purge
Methods included from ParallelClient
Constructor Details
This class inherits a constructor from Ecfr::Base
Instance Attribute Details
#date ⇒ Date (readonly)
the max up to date value of all Titles
51 52 53 |
# File 'lib/ecfr/versioner_service/title.rb', line 51 :date, type: :date, desc: "the max up to date value of all Titles" |
#import_in_progress ⇒ Boolean (readonly)
whether any Title is undergoing processing
54 55 56 |
# File 'lib/ecfr/versioner_service/title.rb', line 54 :import_in_progress, type: :boolean, desc: "whether any Title is undergoing processing" |
#latest_amended_on ⇒ Date (readonly)
the most recent date that the Title has been amended on
39 40 41 |
# File 'lib/ecfr/versioner_service/title.rb', line 39 attribute :latest_amended_on, type: :date, desc: "the most recent date that the Title has been amended on" |
#latest_issue_date ⇒ Date (readonly)
the most recent issue of the Title
42 43 44 |
# File 'lib/ecfr/versioner_service/title.rb', line 42 attribute :latest_issue_date, type: :date, desc: "the most recent issue of the Title" |
#name ⇒ String (readonly)
name of Title
25 26 |
# File 'lib/ecfr/versioner_service/title.rb', line 25 attribute :name, desc: "name of Title" |
#number ⇒ Integer (readonly)
Title number
28 29 30 |
# File 'lib/ecfr/versioner_service/title.rb', line 28 attribute :number, type: :integer, desc: "Title number" |
#processing_in_progress ⇒ Boolean (readonly)
whether the Title is currently being processed
32 33 34 |
# File 'lib/ecfr/versioner_service/title.rb', line 32 attribute :processing_in_progress, type: :boolean, desc: "whether the Title is currently being processed" |
#reserved ⇒ Boolean (readonly)
whether the Title is Reserved
35 36 37 |
# File 'lib/ecfr/versioner_service/title.rb', line 35 attribute :reserved, type: :boolean, desc: "whether the Title is Reserved" |
#up_to_date_as_of ⇒ Date (readonly)
the date through which the Title considered curent
45 46 47 |
# File 'lib/ecfr/versioner_service/title.rb', line 45 attribute :up_to_date_as_of, type: :date, desc: "the date through which the Title considered curent" |
Class Method Details
.all(options = {}) ⇒ <Title>
Retreive the list of all Titles
69 70 71 72 73 74 75 |
# File 'lib/ecfr/versioner_service/title.rb', line 69 def self.all( = {}) perform( :get, TITLES_PATH, params: .compact ) end |
.response_for(titles) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/ecfr/testing/extensions/versioner_service/title_extenstions.rb', line 4 def self.response_for(titles) titles = titles.is_a?(Array) ? titles : [titles] results = { titles: titles, meta: titles.first.fetch("meta", nil) }.compact build( response: stubbed_response(results.to_json) ) end |