Class: EdifactConverter::XML112EDI::XmlReader
- Inherits:
-
Object
- Object
- EdifactConverter::XML112EDI::XmlReader
- Defined in:
- lib/edifact_converter/xml112edi/xml_reader.rb
Instance Attribute Summary collapse
-
#edifact ⇒ Object
Returns the value of attribute edifact.
-
#handler ⇒ Object
Returns the value of attribute handler.
-
#state ⇒ Object
Returns the value of attribute state.
Instance Method Summary collapse
-
#initialize ⇒ XmlReader
constructor
A new instance of XmlReader.
- #parse(xmlstr, properties) ⇒ Object
Constructor Details
#initialize ⇒ XmlReader
Returns a new instance of XmlReader.
10 11 12 13 |
# File 'lib/edifact_converter/xml112edi/xml_reader.rb', line 10 def initialize() self.edifact = EdiHandler.new self.handler = ChecksumHandler.new edifact end |
Instance Attribute Details
#edifact ⇒ Object
Returns the value of attribute edifact.
8 9 10 |
# File 'lib/edifact_converter/xml112edi/xml_reader.rb', line 8 def edifact @edifact end |
#handler ⇒ Object
Returns the value of attribute handler.
8 9 10 |
# File 'lib/edifact_converter/xml112edi/xml_reader.rb', line 8 def handler @handler end |
#state ⇒ Object
Returns the value of attribute state.
8 9 10 |
# File 'lib/edifact_converter/xml112edi/xml_reader.rb', line 8 def state @state end |
Instance Method Details
#parse(xmlstr, properties) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/edifact_converter/xml112edi/xml_reader.rb', line 15 def parse(xmlstr, properties) xml11 = if xmlstr.is_a? String Nokogiri::XML(xmlstr) { |config| config.nonet } else xmlstr end xml11.errors.each do |error| properties[:errors] << EdifactConverter::Message.from_syntax_error(error) end parse_xml xml11 end |