Module: CGI::QueryExtension

Defined in:
lib/upload_progress/lib/multipart_progress.rb

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(obj) ⇒ Object

Need to do lazy aliasing on the instance that we are extending because of the way QueryExtension gets included for each instance of the CGI object rather than on a module level. This method is a bit obtrusive because we are overriding CGI::QueryExtension::extended which could be used in the future. Need to research a better method



100
101
102
103
104
105
106
# File 'lib/upload_progress/lib/multipart_progress.rb', line 100

def self.extended(obj)
  obj.instance_eval do
    # unless defined? will prevent clobbering the progress IO on multiple extensions
    alias :stdinput_without_progress :stdinput unless defined? stdinput_without_progress
    alias :stdinput :stdinput_with_progress 
  end
end

Instance Method Details

#stdinput_with_progressObject



108
109
110
# File 'lib/upload_progress/lib/multipart_progress.rb', line 108

def stdinput_with_progress
  @stdin_with_progress or stdinput_without_progress
end