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"
Instance Attribute Summary collapse
-
#xml ⇒ String
readonly
XML document.
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
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
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/ecfr/versioner_service/xml_content.rb', line 25 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
45 46 47 48 49 |
# File 'lib/ecfr/versioner_service/xml_content.rb', line 45 def self.url_for(date, title_number, = {}) path = xml_content_path(date, title_number) client.build_url(path, ).to_s end |