Class: Texas::OutputHelper::TraceInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/texas/output_helper.rb

Constant Summary collapse

COL_LENGTH =
20

Instance Method Summary collapse

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

#leftObject



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

#rightObject



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_sObject



53
54
55
# File 'lib/texas/output_helper.rb', line 53

def to_s
  left + right
end