Class: Tlog::Output
- Inherits:
-
Object
- Object
- Tlog::Output
- Defined in:
- lib/tlog/output.rb
Instance Attribute Summary collapse
-
#stderr ⇒ Object
Returns the value of attribute stderr.
-
#stdout ⇒ Object
Returns the value of attribute stdout.
Instance Method Summary collapse
- #error(err) ⇒ Object
-
#initialize(stdout, stderr) ⇒ Output
constructor
A new instance of Output.
- #line(out) ⇒ Object
- #line_red(out) ⇒ Object
- #line_yellow(out) ⇒ Object
Constructor Details
#initialize(stdout, stderr) ⇒ Output
Returns a new instance of Output.
7 8 9 10 |
# File 'lib/tlog/output.rb', line 7 def initialize(stdout,stderr) @stdout = stdout @stderr = stderr end |
Instance Attribute Details
#stderr ⇒ Object
Returns the value of attribute stderr.
5 6 7 |
# File 'lib/tlog/output.rb', line 5 def stderr @stderr end |
#stdout ⇒ Object
Returns the value of attribute stdout.
4 5 6 |
# File 'lib/tlog/output.rb', line 4 def stdout @stdout end |
Instance Method Details
#error(err) ⇒ Object
12 13 14 |
# File 'lib/tlog/output.rb', line 12 def error(err) @stderr.puts err end |
#line(out) ⇒ Object
16 17 18 19 |
# File 'lib/tlog/output.rb', line 16 def line(out) @stdout.puts out true end |
#line_red(out) ⇒ Object
25 26 27 |
# File 'lib/tlog/output.rb', line 25 def line_red(out) @stdout.puts out.red end |
#line_yellow(out) ⇒ Object
21 22 23 |
# File 'lib/tlog/output.rb', line 21 def line_yellow(out) @stdout.puts out.yellow end |