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



464
465
466
467
# File 'lib/al_main.rb', line 464

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

#flushObject



469
470
# File 'lib/al_main.rb', line 469

def flush()
end

#write(s) ⇒ Object



457
458
459
460
461
462
# File 'lib/al_main.rb', line 457

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