Merge pull request #2711 from dasch/patch-3

Refactor ActionDispatch::Http::UploadedFile
This commit is contained in:
Aaron Patterson
2011-08-28 09:52:54 -07:00

View File

@@ -11,24 +11,13 @@ module ActionDispatch
raise(ArgumentError, ':tempfile is required') unless @tempfile
end
def open
@tempfile.open
end
def path
@tempfile.path
end
def read(*args)
@tempfile.read(*args)
end
def rewind
@tempfile.rewind
end
def size
@tempfile.size
# Delegate these methods to the tempfile.
[:open, :path, :rewind, :size].each do |method|
class_eval "def #{method}; @tempfile.#{method}; end"
end
private