1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Refactor ActionDispatch::Http::UploadedFile

This commit is contained in:
Daniel Schierbeck 2011-08-28 07:24:58 +03:00
parent bb4dedbc2c
commit 62a61add7e

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