diff options
author | Daniel Schierbeck <daniel.schierbeck@gmail.com> | 2011-08-28 07:24:58 +0300 |
---|---|---|
committer | Daniel Schierbeck <daniel.schierbeck@gmail.com> | 2011-08-28 16:16:22 +0200 |
commit | 62a61add7e7555aae80660f3694e09624be192f3 (patch) | |
tree | 0acf261a1b1ad92e5da278a4063f3c948cde9a17 /actionpack/lib/action_dispatch | |
parent | bb4dedbc2cc7b96b95bf4519f56ed9624949a7ef (diff) | |
download | rails-62a61add7e7555aae80660f3694e09624be192f3.tar.gz rails-62a61add7e7555aae80660f3694e09624be192f3.tar.bz2 rails-62a61add7e7555aae80660f3694e09624be192f3.zip |
Refactor ActionDispatch::Http::UploadedFile
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/http/upload.rb | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/actionpack/lib/action_dispatch/http/upload.rb b/actionpack/lib/action_dispatch/http/upload.rb index a15ad28f16..94fa747a79 100644 --- a/actionpack/lib/action_dispatch/http/upload.rb +++ b/actionpack/lib/action_dispatch/http/upload.rb @@ -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 |