Sha256: 10ec59e99ec0170f2a27cbd403c273327c080c6d4df56af917658f25709f541f

Contents?: true

Size: 420 Bytes

Versions: 2

Compression:

Stored size: 420 Bytes

Contents

require 'curl'
require 'rest_client'

module Qa::Authorities
  class WebServiceBase
    attr_accessor :response, :raw_response

    # mix-in to retreive and parse JSON content from the web
    def get_json(url)
      r = RestClient.get url, {accept: :json}
      self.response = JSON.parse(r)
    end

    # This method should be removed
    # use #response instead
    def results
      self.response
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
qa-0.0.3 lib/qa/authorities/web_service_base.rb
qa-0.0.2 lib/qa/authorities/web_service_base.rb