Sha256: a0f37e36664f2314993399c439a647d3856fc56ddfd4e96e272070ea74bfb268

Contents?: true

Size: 1.14 KB

Versions: 24

Compression:

Stored size: 1.14 KB

Contents

module RemoteResource
  module Connection
    extend ActiveSupport::Concern

    included do
      class_attribute :extension, :default_headers, instance_accessor: false

      self.default_headers = {}
    end

    module ClassMethods

      def connection
        Typhoeus::Request
      end

      def content_type=(content_type)
        warn '[DEPRECATION] `.content_type=` is deprecated. Please use `.extension=` instead.'
        self.extension = content_type
      end

      def content_type
        warn '[DEPRECATION] `.content_type` is deprecated. Please use `.extension` instead.'
        self.extension
      end

      def extra_headers=(_)
        warn '[DEPRECATION] `.extra_headers=` is deprecated. Please overwrite the .headers method to set custom headers.'
      end

      def extra_headers
        warn '[DEPRECATION] `.extra_headers` is deprecated. Please overwrite the .headers method to set custom headers.'
      end

      def headers=(_)
        warn '[WARNING] `.headers=` can not be used to set custom headers. Please overwrite the .headers method to set custom headers.'
      end

      def headers
        {}
      end

    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
ddy_remote_resource-1.3.4 lib/remote_resource/connection.rb
ddy_remote_resource-1.3.3 lib/remote_resource/connection.rb
ddy_remote_resource-1.3.2 lib/remote_resource/connection.rb
ddy_remote_resource-1.3.1 lib/remote_resource/connection.rb
ddy_remote_resource-1.2.3 lib/remote_resource/connection.rb
ddy_remote_resource-1.2.2 lib/remote_resource/connection.rb
ddy_remote_resource-1.2.1 lib/remote_resource/connection.rb
ddy_remote_resource-1.2.0 lib/remote_resource/connection.rb
ddy_remote_resource-1.1.2 lib/remote_resource/connection.rb
ddy_remote_resource-1.1.1 lib/remote_resource/connection.rb
ddy_remote_resource-1.1.0 lib/remote_resource/connection.rb
ddy_remote_resource-1.0.5 lib/remote_resource/connection.rb
ddy_remote_resource-1.0.4 lib/remote_resource/connection.rb
ddy_remote_resource-1.0.3 lib/remote_resource/connection.rb
ddy_remote_resource-1.0.2 lib/remote_resource/connection.rb
ddy_remote_resource-1.0.1 lib/remote_resource/connection.rb
ddy_remote_resource-1.0.0 lib/remote_resource/connection.rb
ddy_remote_resource-1.0.0.rc7 lib/remote_resource/connection.rb
ddy_remote_resource-1.0.0.rc6 lib/remote_resource/connection.rb
ddy_remote_resource-1.0.0.rc5 lib/remote_resource/connection.rb