Class: HTTPX::Plugins::Multipart::FilePart

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/httpx/plugins/multipart/decoder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename, content_type) ⇒ FilePart

Returns a new instance of FilePart.



15
16
17
18
19
20
# File 'lib/httpx/plugins/multipart/decoder.rb', line 15

def initialize(filename, content_type)
  @original_filename = filename
  @content_type = content_type
  @file = Tempfile.new("httpx", encoding: Encoding::BINARY, mode: File::RDWR)
  super(@file)
end

Instance Attribute Details

#content_typeObject (readonly)

Returns the value of attribute content_type.



13
14
15
# File 'lib/httpx/plugins/multipart/decoder.rb', line 13

def content_type
  @content_type
end

#original_filenameObject (readonly)

Returns the value of attribute original_filename.



13
14
15
# File 'lib/httpx/plugins/multipart/decoder.rb', line 13

def original_filename
  @original_filename
end