Sha256: 160df067d320028d88522f38057d1b82fd9088d006d696983ca6a16727b49efb

Contents?: true

Size: 560 Bytes

Versions: 1

Compression:

Stored size: 560 Bytes

Contents

# frozen_string_literal: true
require 'active_support/core_ext/hash/conversions'

module Roqua
  module Healthy
    module A19
      class ResponseParser
        attr_reader :response

        def initialize(response)
          @response = response
        end

        def fetch(root)
          parsed_body[root] || {}
        end

        private

        def parsed_body
          @parsed_body ||= Hash.from_xml(response.body)
        rescue REXML::ParseException => e
          raise IllegalMirthResponse, e.message
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
roqua-healthy-1.4.2 lib/roqua/healthy/a19/response_parser.rb