Sha256: f1444a7f00779ae402be234850b8c6a920a7d2c3a307ae279b2f2b21ff11c5dc

Contents?: true

Size: 1.44 KB

Versions: 1

Compression:

Stored size: 1.44 KB

Contents

require 'curb-fu'

class Fastly
  class Client
    # :nodoc: all
    class Curl
      attr_accessor :uri, :host, :port, :protocol

      def initialize(uri)
        @uri      = uri
        @host     = uri.host
        @port     = uri.port
        @protocol = uri.scheme
      end

      def get(path, headers = {})
        CurbFu.get({
                     host:     host,
                     port:     port,
                     path:     path,
                     headers:  headers,
                     protocol: protocol
                   })
      end

      def post(path, params, headers = {})
        CurbFu.post({
                      host:     host,
                      port:     port,
                      path:     path,
                      headers:  headers,
                      protocol: protocol
                    }, params)
      end

      def put(path, params, headers = {})
        CurbFu.put({
                     host:     host,
                     port:     port,
                     path:     path,
                     headers:  headers,
                     protocol: protocol
                   }, params)
      end

      def delete(path, headers = {})
        CurbFu.delete({
                        host:     host,
                        port:     port,
                        path:     path,
                        headers:  headers,
                        protocol: protocol
                      })
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fastly-1.1.5 lib/fastly/client/curl.rb