Blame view

lib/syspro/business_objects/parsers/portii_parser.rb 640 Bytes
6a873e0f   chadzink   Implement PorTii ...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  # frozen_string_literal: true
  
  module Syspro
    module BusinessObjects
      module Parsers
        class PorTiiParser
          attr_reader :doc
  
          def initialize(doc)
            @doc = doc
          end
  
          def parse
            {
b1c0def6   Samuel J Clopton   rubocop violation...
15
16
17
18
              error_numbers: doc.xpath('//ErrorNumber').map(&:text),
              grn_numbers: doc.xpath('//Item/Key/GRNNumber').map(&:text),
              items_processed: doc.xpath('//StatusOfItems/ItemsProcessed').first.text,
              items_invalid: doc.xpath('//StatusOfItems/ItemsInvalid').first.text
6a873e0f   chadzink   Implement PorTii ...
19
20
21
22
23
24
25
26
            }
          end
  
          PorToiObject = Struct.new(:key, :receipts)
        end
      end
    end
  end