Class: AlGraph::GraphOutput
- Inherits:
-
Object
- Object
- AlGraph::GraphOutput
- Defined in:
- lib/al_graph_base.rb
Overview
出力制御クラス
Instance Attribute Summary collapse
-
#mode ⇒ Object
readonly
出力モード :STDOUT or :BUFFER.
-
#out_buf ⇒ Object
readonly
出力バッファ.
Instance Method Summary collapse
-
#initialize ⇒ GraphOutput
constructor
constructor.
-
#printf(*arg) ⇒ Object
出力.
-
#switch_mode(mode) ⇒ Object
出力先を切り替え.
Constructor Details
#initialize ⇒ GraphOutput
constructor
383 384 385 386 |
# File 'lib/al_graph_base.rb', line 383 def initialize() @mode = :STDOUT @out_buf = "" end |
Instance Attribute Details
#mode ⇒ Object (readonly)
出力モード :STDOUT or :BUFFER
378 379 380 |
# File 'lib/al_graph_base.rb', line 378 def mode @mode end |
#out_buf ⇒ Object (readonly)
出力バッファ
377 378 379 |
# File 'lib/al_graph_base.rb', line 377 def out_buf @out_buf end |
Instance Method Details
#printf(*arg) ⇒ Object
出力
393 394 395 396 397 398 399 |
# File 'lib/al_graph_base.rb', line 393 def printf(*arg) if @mode == :STDOUT Kernel.printf(*arg) else @out_buf << Kernel.sprintf(*arg) end end |
#switch_mode(mode) ⇒ Object
出力先を切り替え
406 407 408 409 |
# File 'lib/al_graph_base.rb', line 406 def switch_mode( mode ) @out_buf = "" @mode = mode end |