Class: Alone::OutputTrap

Inherits:
Object
  • Object
show all
Defined in:
lib/al_main.rb

Overview

Note:

Alone標準出力トラップクラス

httpヘッダを出すために、一時的に出力をトラップする。

Instance Method Summary collapse

Instance Method Details

#<<(arg) ⇒ Object



462
463
464
465
# File 'lib/al_main.rb', line 462

def <<( arg )
  write( arg )
  return self
end

#flushObject



467
468
# File 'lib/al_main.rb', line 467

def flush()
end

#write(s) ⇒ Object



455
456
457
458
459
460
# File 'lib/al_main.rb', line 455

def write( s )
  $stdout = STDOUT
  $stderr = STDOUT
  Alone::send_http_headers()
  print( s )
end