Class: OfacSdn::Document
- Inherits:
-
Object
- Object
- OfacSdn::Document
- Defined in:
- lib/ofac_sdn/document.rb
Overview
OfacSdn::Document holds the XML OFAC document
Instance Attribute Summary collapse
-
#data_url ⇒ Object
readonly
Returns the value of attribute data_url.
-
#xml_path ⇒ Object
readonly
Returns the value of attribute xml_path.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize ⇒ Document
constructor
A new instance of Document.
Constructor Details
#initialize ⇒ Document
Returns a new instance of Document.
15 16 17 18 |
# File 'lib/ofac_sdn/document.rb', line 15 def initialize @data_url = 'https://www.treasury.gov/ofac/downloads/sdn.xml'.freeze @xml_path = open(data_url) end |
Instance Attribute Details
#data_url ⇒ Object (readonly)
Returns the value of attribute data_url.
13 14 15 |
# File 'lib/ofac_sdn/document.rb', line 13 def data_url @data_url end |
#xml_path ⇒ Object (readonly)
Returns the value of attribute xml_path.
13 14 15 |
# File 'lib/ofac_sdn/document.rb', line 13 def xml_path @xml_path end |
Class Method Details
.call ⇒ Object
10 11 12 |
# File 'lib/ofac_sdn/document.rb', line 10 def self.call new.call end |
Instance Method Details
#call ⇒ Object
20 21 22 |
# File 'lib/ofac_sdn/document.rb', line 20 def call Nokogiri::XML(xml_path) end |