Sha256: d14e847e96fcc8398480a664af6b935ea29d4235cbdad3694334f0100dfaa750

Contents?: true

Size: 391 Bytes

Versions: 3

Compression:

Stored size: 391 Bytes

Contents

require 'rest-client'

module TimesBooks
  module Request
  
    def request(path, params)
      api_key = TimesBooks.configuration[:api_key]
      params = params.merge(:api_key=>api_key).to_query
      url = "#{path}?#{params}"
      result = RestClient.get(url) 
      
      parse(result)
    end

    def parse(result)
      hash = JSON.parse(result)
      return hash
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
times_books-0.1.2 lib/times_books/request.rb
times_books-0.1.1 lib/times_books/request.rb
times_books-0.1.0 lib/times_books/request.rb