Class: OfacSdn::Document

Inherits:
Object
  • Object
show all
Defined in:
lib/ofac_sdn/document.rb

Overview

OfacSdn::Document holds the XML OFAC document

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDocument

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_urlObject (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_pathObject (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

.callObject



10
11
12
# File 'lib/ofac_sdn/document.rb', line 10

def self.call
  new.call
end

Instance Method Details

#callObject



20
21
22
# File 'lib/ofac_sdn/document.rb', line 20

def call
  Nokogiri::XML(xml_path)
end