Sha256: 6fe1ef8b3e50935b14eefb460d5d793293c57d156365752e4da487ec19d02fe8

Contents?: true

Size: 534 Bytes

Versions: 12

Compression:

Stored size: 534 Bytes

Contents

# frozen_string_literal: true

require "delegate"

module Pakyow
  class Connection
    class MultipartInput < SimpleDelegator
      attr_reader :filename, :headers, :type

      def initialize(filename:, headers:, type:)
        @filename, @headers, @type = filename, headers, type
        __setobj__(Tempfile.new(["PakyowMultipart", File.extname(filename)]))
      end

      alias media_type type

      # Fixes an issue using pp inside a delegator.
      #
      def pp(*args)
        Kernel.pp(*args)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
pakyow-core-1.0.6 lib/pakyow/connection/multipart_input.rb
pakyow-core-1.0.5 lib/pakyow/connection/multipart_input.rb
pakyow-core-1.0.4 lib/pakyow/connection/multipart_input.rb
pakyow-core-1.0.3 lib/pakyow/connection/multipart_input.rb
pakyow-core-1.0.2 lib/pakyow/connection/multipart_input.rb
pakyow-core-1.0.1 lib/pakyow/connection/multipart_input.rb
pakyow-core-1.0.0 lib/pakyow/connection/multipart_input.rb
pakyow-core-1.0.0.rc5 lib/pakyow/connection/multipart_input.rb
pakyow-core-1.0.0.rc4 lib/pakyow/connection/multipart_input.rb
pakyow-core-1.0.0.rc3 lib/pakyow/connection/multipart_input.rb
pakyow-core-1.0.0.rc2 lib/pakyow/connection/multipart_input.rb
pakyow-core-1.0.0.rc1 lib/pakyow/connection/multipart_input.rb