Class: Rosette::Client::Terminal
- Inherits:
-
Object
- Object
- Rosette::Client::Terminal
- Defined in:
- lib/rosette/client/terminal.rb
Instance Attribute Summary collapse
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
Instance Method Summary collapse
-
#initialize(stream = STDOUT) ⇒ Terminal
constructor
A new instance of Terminal.
- #say(str, color = :none) ⇒ Object
Constructor Details
#initialize(stream = STDOUT) ⇒ Terminal
Returns a new instance of Terminal.
11 12 13 |
# File 'lib/rosette/client/terminal.rb', line 11 def initialize(stream = STDOUT) @stream = stream end |
Instance Attribute Details
#stream ⇒ Object (readonly)
Returns the value of attribute stream.
9 10 11 |
# File 'lib/rosette/client/terminal.rb', line 9 def stream @stream end |
Instance Method Details
#say(str, color = :none) ⇒ Object
15 16 17 18 |
# File 'lib/rosette/client/terminal.rb', line 15 def say(str, color = :none) stream.write(colorize(str, color)) stream.write("\n") end |