Sha256: 63e89df6be80adaa17d02d9013e1c49fb3ebcbb977fa57c30d92fccc74d98b32

Contents?: true

Size: 333 Bytes

Versions: 2

Compression:

Stored size: 333 Bytes

Contents

require 'rest_client'

module Qa::Authorities
  class WebServiceBase < Base
    attr_accessor :raw_response

    # mix-in to retreive and parse JSON content from the web
    def get_json(url)
      r = RestClient.get url, request_options
      JSON.parse(r)
    end

    def request_options
      { accept: :json }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
qa-0.4.2 lib/qa/authorities/web_service_base.rb
qa-0.4.1 lib/qa/authorities/web_service_base.rb