Sha256: 53b32f895b3d57401d8b81297ce02c896748acffd8edec122c438c7516b7f0af

Contents?: true

Size: 489 Bytes

Versions: 10

Compression:

Stored size: 489 Bytes

Contents

module RemoteResource
  module Connection
    extend ActiveSupport::Concern

    included do
      class_attribute :content_type, :default_headers, :extra_headers, instance_accessor: false

      self.content_type    = '.json'
      self.default_headers = { "Accept" => "application/json" }
    end

    module ClassMethods

      def connection
        Typhoeus::Request
      end

      def headers
        self.default_headers.merge self.extra_headers || {}
      end

    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ddy_remote_resource-0.4.11 lib/remote_resource/connection.rb
ddy_remote_resource-0.4.10 lib/remote_resource/connection.rb
ddy_remote_resource-0.4.9 lib/remote_resource/connection.rb
ddy_remote_resource-0.4.8 lib/remote_resource/connection.rb
ddy_remote_resource-0.4.7 lib/remote_resource/connection.rb
ddy_remote_resource-0.4.6 lib/remote_resource/connection.rb
ddy_remote_resource-0.4.5 lib/remote_resource/connection.rb
ddy_remote_resource-0.4.4 lib/remote_resource/connection.rb
ddy_remote_resource-0.4.3 lib/remote_resource/connection.rb
ddy_remote_resource-0.4.2 lib/remote_resource/connection.rb