Sha256: 5814f9b19d04a4ca9ac74238ec8ee527e9aaeb77702ca762d7d329e2bf926e0b

Contents?: true

Size: 563 Bytes

Versions: 17

Compression:

Stored size: 563 Bytes

Contents

require_relative 'base_endpoint'

module Panoptes
  module Endpoints
    class JsonEndpoint < BaseEndpoint
      # Automatically configured connection to use JSON requests/responses
      # @see Panoptes::Endpoints::BaseEndpoint#initialize
      def initialize(auth: {}, url: nil, prefix: nil, &config)
        super auth: auth, url: url, prefix: prefix do |faraday|
          config.call(faraday) if config
          faraday.request :json
          faraday.response :json
          faraday.adapter Faraday.default_adapter
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
panoptes-client-1.0.0.pre1 lib/panoptes/endpoints/json_endpoint.rb
panoptes-client-1.0.0.pre lib/panoptes/endpoints/json_endpoint.rb
panoptes-client-0.4.0 lib/panoptes/endpoints/json_endpoint.rb
panoptes-client-0.3.8 lib/panoptes/endpoints/json_endpoint.rb
panoptes-client-0.3.7 lib/panoptes/endpoints/json_endpoint.rb
panoptes-client-0.3.6 lib/panoptes/endpoints/json_endpoint.rb
panoptes-client-0.3.5 lib/panoptes/endpoints/json_endpoint.rb
panoptes-client-0.3.4 lib/panoptes/endpoints/json_endpoint.rb
panoptes-client-0.3.3 lib/panoptes/endpoints/json_endpoint.rb
panoptes-client-0.3.2 lib/panoptes/endpoints/json_endpoint.rb
panoptes-client-0.3.1 lib/panoptes/endpoints/json_endpoint.rb
panoptes-client-0.3.0 lib/panoptes/endpoints/json_endpoint.rb
panoptes-client-0.2.13 lib/panoptes/endpoints/json_endpoint.rb
panoptes-client-0.2.12 lib/panoptes/endpoints/json_endpoint.rb
panoptes-client-0.2.11 lib/panoptes/endpoints/json_endpoint.rb
panoptes-client-0.2.10 lib/panoptes/endpoints/json_endpoint.rb
panoptes-client-0.2.9 lib/panoptes/endpoints/json_endpoint.rb