Class: ActionController::Integration::Session::StubCGI

Inherits:
CGI
  • Object
show all
Defined in:
lib/action_controller/integration.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from CGI

escapeHTML, escapeHTML_fail_on_nil

Methods included from CgiExt::Stdinput

included, #initialize_with_stdinput

Constructor Details

#initialize(env, stdinput = nil) ⇒ StubCGI

Returns a new instance of StubCGI.



225
226
227
228
229
230
231
232
233
234
# File 'lib/action_controller/integration.rb', line 225

def initialize(env, stdinput = nil)
  self.env_table = env
  self.stdoutput = StringIO.new

  super

  stdinput.set_encoding(Encoding::BINARY) if stdinput.respond_to?(:set_encoding)
  stdinput.force_encoding(Encoding::BINARY) if stdinput.respond_to?(:force_encoding)
  @stdinput = stdinput.is_a?(IO) ? stdinput : StringIO.new(stdinput || '')
end

Instance Attribute Details

#env_tableObject

Returns the value of attribute env_table.



223
224
225
# File 'lib/action_controller/integration.rb', line 223

def env_table
  @env_table
end

#stdinputObject

Returns the value of attribute stdinput.



223
224
225
# File 'lib/action_controller/integration.rb', line 223

def stdinput
  @stdinput
end

#stdoutputObject

Returns the value of attribute stdoutput.



223
224
225
# File 'lib/action_controller/integration.rb', line 223

def stdoutput
  @stdoutput
end