Sha256: 030bdfd1d64e105c97cf2e6c2a7546cbb32daf762f7a5964fced5d4a51498e1a

Contents?: true

Size: 529 Bytes

Versions: 14

Compression:

Stored size: 529 Bytes

Contents

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

14 entries across 14 versions & 1 rubygems

Version Path
roqua-healthy-1.2.0 lib/roqua/healthy/a19/response_parser.rb
roqua-healthy-1.1.9 lib/roqua/healthy/a19/response_parser.rb
roqua-healthy-1.1.8 lib/roqua/healthy/a19/response_parser.rb
roqua-healthy-1.1.7 lib/roqua/healthy/a19/response_parser.rb
roqua-healthy-1.1.6 lib/roqua/healthy/a19/response_parser.rb
roqua-healthy-1.1.5 lib/roqua/healthy/a19/response_parser.rb
roqua-healthy-1.1.4 lib/roqua/healthy/a19/response_parser.rb
roqua-healthy-1.1.3 lib/roqua/healthy/a19/response_parser.rb
roqua-healthy-1.1.2 lib/roqua/healthy/a19/response_parser.rb
roqua-healthy-1.1.1 lib/roqua/healthy/a19/response_parser.rb
roqua-healthy-1.1.0 lib/roqua/healthy/a19/response_parser.rb
roqua-healthy-1.0.2 lib/roqua/healthy/a19/response_parser.rb
roqua-healthy-1.0.1 lib/roqua/healthy/a19/response_parser.rb
roqua-healthy-1.0.0 lib/roqua/healthy/a19/response_parser.rb