Class: Texas::OutputHelper::TraceInfo
- Inherits:
-
Object
- Object
- Texas::OutputHelper::TraceInfo
- Defined in:
- lib/texas/output_helper.rb
Constant Summary collapse
- COL_LENGTH =
20
Instance Method Summary collapse
-
#initialize(left, right, color = nil) ⇒ TraceInfo
constructor
A new instance of TraceInfo.
- #left ⇒ Object
- #right ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(left, right, color = nil) ⇒ TraceInfo
Returns a new instance of TraceInfo.
37 38 39 |
# File 'lib/texas/output_helper.rb', line 37 def initialize(left, right, color = nil) @left, @right, @color = left, right, color end |
Instance Method Details
#left ⇒ Object
41 42 43 44 45 |
# File 'lib/texas/output_helper.rb', line 41 def left l = (@left.to_s + " ").rjust(COL_LENGTH) l = l.__send__(@color) if @color l.bold end |
#right ⇒ Object
47 48 49 50 51 |
# File 'lib/texas/output_helper.rb', line 47 def right r = @right.to_s r = r.__send__(@color) if @color r end |
#to_s ⇒ Object
53 54 55 |
# File 'lib/texas/output_helper.rb', line 53 def to_s left + right end |