Class: Tuile::Component::LogWindow::IO
- Inherits:
-
Object
- Object
- Tuile::Component::LogWindow::IO
- Defined in:
- lib/tuile/component/log_window.rb,
sig/tuile.rbs
Overview
IO-shaped adapter that forwards each log line to the owning Tuile::Component::LogWindow.
Implements both #write (stdlib Logger) and #puts (loggers that
call output.puts, e.g. TTY::Logger).
Instance Method Summary collapse
- #close ⇒ void
-
#initialize(window) ⇒ IO
constructor
@param
window. -
#puts(string) ⇒ void
@param
string. -
#write(string) ⇒ void
@param
string.
Constructor Details
#initialize(window) ⇒ IO
@param window
43 44 45 |
# File 'lib/tuile/component/log_window.rb', line 43 def initialize(window) @window = window end |
Instance Method Details
#close ⇒ void
63 |
# File 'lib/tuile/component/log_window.rb', line 63 def close; end |
#puts(string) ⇒ void
This method returns an undefined value.
@param string
55 56 57 |
# File 'lib/tuile/component/log_window.rb', line 55 def puts(string) @window.log(string) end |
#write(string) ⇒ void
This method returns an undefined value.
@param string
49 50 51 |
# File 'lib/tuile/component/log_window.rb', line 49 def write(string) @window.log(string.chomp) end |