Parent

Class Index [+]

Quicksearch

ActionDispatch::Http::UploadedFile

Attributes

original_filename[RW]
content_type[RW]
tempfile[RW]
headers[RW]

Public Class Methods

new(hash) click to toggle source
    # File lib/action_dispatch/http/upload.rb, line 6
 6:       def initialize(hash)
 7:         @original_filename = encode_filename(hash[:filename])
 8:         @content_type      = hash[:type]
 9:         @headers           = hash[:head]
10:         @tempfile          = hash[:tempfile]
11:         raise(ArgumentError, ':tempfile is required') unless @tempfile
12:       end

Public Instance Methods

read(*args) click to toggle source
    # File lib/action_dispatch/http/upload.rb, line 14
14:       def read(*args)
15:         @tempfile.read(*args)
16:       end

Private Instance Methods

encode_filename(filename) click to toggle source
    # File lib/action_dispatch/http/upload.rb, line 24
24:       def encode_filename(filename)
25:         # Encode the filename in the utf8 encoding, unless it is nil or we're in 1.8
26:         if "ruby".encoding_aware? && filename
27:           filename.force_encoding("UTF-8").encode!
28:         else
29:           filename
30:         end
31:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.