Class: Pakyow::Connection::MultipartInput

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/pakyow/connection/multipart_input.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename:, headers:, type:) ⇒ MultipartInput

Returns a new instance of MultipartInput.



10
11
12
13
# File 'lib/pakyow/connection/multipart_input.rb', line 10

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

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



8
9
10
# File 'lib/pakyow/connection/multipart_input.rb', line 8

def filename
  @filename
end

#headersObject (readonly)

Returns the value of attribute headers.



8
9
10
# File 'lib/pakyow/connection/multipart_input.rb', line 8

def headers
  @headers
end

#typeObject (readonly) Also known as: media_type

Returns the value of attribute type.



8
9
10
# File 'lib/pakyow/connection/multipart_input.rb', line 8

def type
  @type
end

Instance Method Details

#pp(*args) ⇒ Object

Fixes an issue using pp inside a delegator.



19
20
21
# File 'lib/pakyow/connection/multipart_input.rb', line 19

def pp(*args)
  Kernel.pp(*args)
end