Sha256: f2090fe68a77833ef2f390dd0ff9b379374e338393795832367771eee528cd00

Contents?: true

Size: 991 Bytes

Versions: 8

Compression:

Stored size: 991 Bytes

Contents

require 'json'

module Uploadcare
  module RawApi

    def initialize options={}
      @options = Uploadcare::default_settings.merge(options)
      @api_connection = Uploadcare::Connections::ApiConnection.new(@options)
      @upload_connection = Uploadcare::Connections::UploadConnection.new(@options)
    end


    # basic request method 
    def request method = :get, path = "/files/", params = {}
      response = @api_connection.send method, path, params 
      response.body
    end
    alias_method :api_request, :request


    # request with GET verb
    def get path= "/files/", params={}
      request :get, path, params
    end


    # request with POST verb
    def post path= "/files/", params={}
      request :post, path, params 
    end


    # request with PUT verb
    def put path= "/files/", params={}
      request :put, path, params
    end


    # request with DELETE verb
    def delete path= "/files/", params={}
      request :delete, path, params
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
uploadcare-ruby-1.2.2 lib/uploadcare/api/raw_api.rb
uploadcare-ruby-1.2.1 lib/uploadcare/api/raw_api.rb
uploadcare-ruby-1.1.0 lib/uploadcare/api/raw_api.rb
uploadcare-ruby-1.0.6 lib/uploadcare/api/raw_api.rb
uploadcare-ruby-1.0.5 lib/uploadcare/api/raw_api.rb
uploadcare-ruby-1.0.4 lib/uploadcare/api/raw_api.rb
uploadcare-ruby-1.0.3 lib/uploadcare/api/raw_api.rb
uploadcare-ruby-1.0.2 lib/uploadcare/api/raw_api.rb