Sha256: 360f0c8387630b9500e9707dad8effebf4d8dcc89a28b39dfb27ef14b92a4127

Contents?: true

Size: 465 Bytes

Versions: 8

Compression:

Stored size: 465 Bytes

Contents

module Staccato
  module Adapter
    class Faraday # The Faraday Adapter
      def initialize(uri)
        @connection = Faraday.new(uri) do |faraday|
          faraday.request  :url_encoded             # form-encode POST params
          faraday.adapter  Faraday.default_adapter  # make requests with Net::HTTP

          yield faraday if block_given?
        end
      end

      def post(params)
        @connection.post(nil, params)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
staccato-0.4.5 lib/staccato/adapter/faraday.rb
staccato-0.4.4 lib/staccato/adapter/faraday.rb
staccato-0.4.3 lib/staccato/adapter/faraday.rb
staccato-0.4.2 lib/staccato/adapter/faraday.rb
staccato-0.4.1 lib/staccato/adapter/faraday.rb
staccato-0.4.0 lib/staccato/adapter/faraday.rb
staccato-0.3.1 lib/staccato/adapter/faraday.rb
staccato-0.3.0 lib/staccato/adapter/faraday.rb