Class: HTTPX::Transcoder::Multipart::FilePart

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename, content_type) ⇒ FilePart

Returns a new instance of FilePart.



12
13
14
15
16
17
# File 'lib/httpx/transcoder/multipart/decoder.rb', line 12

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.



10
11
12
# File 'lib/httpx/transcoder/multipart/decoder.rb', line 10

def content_type
  @content_type
end

#original_filenameObject (readonly)

Returns the value of attribute original_filename.



10
11
12
# File 'lib/httpx/transcoder/multipart/decoder.rb', line 10

def original_filename
  @original_filename
end