Class: OfacSdn::Parser

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

Overview

OfacSdn::Parser parses the XML document and returns a formatted hash

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xsd:, document:) ⇒ Parser

Returns a new instance of Parser.



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

def initialize(xsd:, document:)
  @xsd = xsd
  @document = document
end

Instance Attribute Details

#documentObject (readonly)

Returns the value of attribute document.



11
12
13
# File 'lib/ofac_sdn/parser.rb', line 11

def document
  @document
end

#resultObject (readonly)

Returns the value of attribute result.



11
12
13
# File 'lib/ofac_sdn/parser.rb', line 11

def result
  @result
end

#xsdObject (readonly)

Returns the value of attribute xsd.



11
12
13
# File 'lib/ofac_sdn/parser.rb', line 11

def xsd
  @xsd
end

Class Method Details

.run(**kwargs) ⇒ Object



7
8
9
# File 'lib/ofac_sdn/parser.rb', line 7

def self.run(**kwargs)
  new(**kwargs).call
end

Instance Method Details

#callObject



18
19
20
21
22
# File 'lib/ofac_sdn/parser.rb', line 18

def call
  initialize_result_hash
  build_hash_with('sdnList > sdnEntry')
  result
end