Class: Ecfr::VersionerService::XmlContent
- Defined in:
- lib/ecfr/versioner_service/xml_content.rb
Overview
The XML endpoint will return the full XML available for a given date and hierarchy.
This is used primarily by our internal import processes and to provide links to XML from the web UI.
Constant Summary collapse
- XML_PATH =
"v1/full"
Constants inherited from Base
Base::SUPPORTED_ARRAY_ACCESSORS
Instance Attribute Summary collapse
-
#xml ⇒ String
readonly
XML document.
Attributes inherited from Base
#metadata, #request_data, #response_status, #results
Class Method Summary collapse
-
.find(date, title_number, options = {}) ⇒ <XML>
Retreive the XML for a given date and hierarchy.
-
.url_for(date, title_number, options = {}) ⇒ <String>
Provides a url to the XML content for a given set of parameters.
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
#xml ⇒ String (readonly)
XML document
11 12 |
# File 'lib/ecfr/versioner_service/xml_content.rb', line 11 attribute :xml, desc: "XML document" |
Class Method Details
.find(date, title_number, options = {}) ⇒ <XML>
Retreive the XML for a given date and hierarchy
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/ecfr/versioner_service/xml_content.rb', line 26 def self.find(date, title_number, = {}) new( { xml: get( xml_content_path(date, title_number), ).body }.stringify_keys ) end |
.url_for(date, title_number, options = {}) ⇒ <String>
Provides a url to the XML content for a given set of parameters
47 48 49 50 51 |
# File 'lib/ecfr/versioner_service/xml_content.rb', line 47 def self.url_for(date, title_number, = {}) path = xml_content_path(date, title_number) client.build_url(path, ).to_s end |