Class: Ecfr::AdminService::EcfrCorrection
- Extended by:
- ResponseHelper
- Defined in:
- lib/ecfr/admin_service/ecfr_correction.rb,
lib/ecfr/admin_service/ecfr_correction/cfr_reference.rb,
lib/ecfr/testing/extensions/admin_service/ecfr_correction_extensions.rb
Defined Under Namespace
Classes: CfrReference
Constant Summary collapse
- CORRECTIONS_PATH =
"v1/corrections.json"
Instance Attribute Summary collapse
-
#cfr_references ⇒ [CfrReference]
readonly
the portions of the CFR this correction applies to.
-
#corrective_action ⇒ String
readonly
description of action taken.
-
#display_in_toc ⇒ Boolean
readonly
whether this correction should be displayed on table of contents pages.
-
#error_corrected ⇒ Date
readonly
date error was corrected.
-
#error_occurred ⇒ Date
readonly
date error first occured.
-
#fr_citation ⇒ String
readonly
Federal Register citation in form of '80 FR 12345'.
- #id ⇒ Integer readonly
-
#last_modified ⇒ Date
readonly
date this correction was last modified.
-
#position ⇒ Integer
readonly
position of correction in list.
-
#title ⇒ Integer
readonly
CFR Title.
-
#year ⇒ Integer
readonly
year of corrective action.
Class Method Summary collapse
-
.all ⇒ [<EcfrCorrection>]
Retrieve the list of all corrections.
- .response_for(corrections) ⇒ Object
-
.where(args) ⇒ [<EcfrCorrection>]
Retrieve a list of corrections filtered by the provided parameters.
Methods included from ResponseHelper
Methods inherited from Base
base_url, service_name, service_path
Instance Attribute Details
#cfr_references ⇒ [CfrReference] (readonly)
the portions of the CFR this correction applies to
35 36 37 |
# File 'lib/ecfr/admin_service/ecfr_correction.rb', line 35 attribute :cfr_references, type: Array(CfrReference), desc: "the portions of the CFR this correction applies to" |
#corrective_action ⇒ String (readonly)
description of action taken
8 9 |
# File 'lib/ecfr/admin_service/ecfr_correction.rb', line 8 attribute :corrective_action, desc: "description of action taken" |
#display_in_toc ⇒ Boolean (readonly)
whether this correction should be displayed on table of contents pages
39 40 41 |
# File 'lib/ecfr/admin_service/ecfr_correction.rb', line 39 attribute :display_in_toc, type: :boolean, desc: "whether this correction should be displayed on table of contents pages" |
#error_corrected ⇒ Date (readonly)
date error was corrected
25 26 27 |
# File 'lib/ecfr/admin_service/ecfr_correction.rb', line 25 attribute :error_corrected, type: :date, desc: "date error was corrected" |
#error_occurred ⇒ Date (readonly)
date error first occured
28 29 30 |
# File 'lib/ecfr/admin_service/ecfr_correction.rb', line 28 attribute :error_occurred, type: :date, desc: "date error first occured" |
#fr_citation ⇒ String (readonly)
Federal Register citation in form of '80 FR 12345'
10 11 |
# File 'lib/ecfr/admin_service/ecfr_correction.rb', line 10 attribute :fr_citation, desc: "Federal Register citation in form of '80 FR 12345'" |
#id ⇒ Integer (readonly)
13 14 |
# File 'lib/ecfr/admin_service/ecfr_correction.rb', line 13 attribute :id, type: :integer |
#last_modified ⇒ Date (readonly)
date this correction was last modified
31 32 33 |
# File 'lib/ecfr/admin_service/ecfr_correction.rb', line 31 attribute :last_modified, type: :date, desc: "date this correction was last modified" |
#position ⇒ Integer (readonly)
position of correction in list
15 16 17 |
# File 'lib/ecfr/admin_service/ecfr_correction.rb', line 15 attribute :position, type: :integer, desc: "position of correction in list" |
#title ⇒ Integer (readonly)
CFR Title
18 19 20 |
# File 'lib/ecfr/admin_service/ecfr_correction.rb', line 18 attribute :title, type: :integer, desc: "CFR Title" |
#year ⇒ Integer (readonly)
year of corrective action
21 22 23 |
# File 'lib/ecfr/admin_service/ecfr_correction.rb', line 21 attribute :year, type: :integer, desc: "year of corrective action" |
Class Method Details
.all ⇒ [<EcfrCorrection>]
Retrieve the list of all corrections
50 51 52 53 54 55 |
# File 'lib/ecfr/admin_service/ecfr_correction.rb', line 50 def self.all perform( :get, CORRECTIONS_PATH ) end |
.response_for(corrections) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/ecfr/testing/extensions/admin_service/ecfr_correction_extensions.rb', line 4 def self.response_for(corrections) results = { ecfr_corrections: corrections.is_a?(Array) ? corrections : [corrections] }.to_json build( response: stubbed_response(results) ) end |
.where(args) ⇒ [<EcfrCorrection>]
Retrieve a list of corrections filtered by the provided parameters
67 68 69 70 71 72 73 74 75 |
# File 'lib/ecfr/admin_service/ecfr_correction.rb', line 67 def self.where(args) args.slice!(:date, :error_corrected_date, :title) perform( :get, CORRECTIONS_PATH, params: args ) end |