Method: Console::Terminal::Text#print
- Defined in:
- lib/console/terminal/text.rb
#print(*arguments) ⇒ Object
Print rich text to the output stream.
-
When the argument is a symbol, look up the style and inject it into the output stream.
-
When the argument is a proc/lambda, call it with self as the argument.
-
When the argument is anything else, write it directly to the output.
107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/console/terminal/text.rb', line 107 def print(*arguments) arguments.each do |argument| case argument when Symbol @stream.write(self[argument]) when Proc argument.call(self) else @stream.write(argument) end end end |