Class: OfacSdn::Read

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

Overview

OfacSdn::Read.call creates the SDN Ruby Hash

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.callObject



13
14
15
# File 'lib/ofac_sdn.rb', line 13

def call
  new.call(document)
end

.documentObject



17
18
19
# File 'lib/ofac_sdn.rb', line 17

def document
  @document ||= Document.call
end

.publish_dateObject



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

def publish_date
  document.css('sdnList publshInformation Publish_Date').text
end

.record_countObject



25
26
27
# File 'lib/ofac_sdn.rb', line 25

def record_count
  document.css('sdnList publshInformation Record_Count').text.to_i
end

Instance Method Details

#call(document) ⇒ Object



30
31
32
# File 'lib/ofac_sdn.rb', line 30

def call(document)
  Parser.run(document: document, xsd: XSD_HASH)
end