Class: Timer::TimerElement

Inherits:
TimerNode show all
Defined in:
lib/pg_graph/timer.rb

Instance Attribute Summary collapse

Attributes inherited from TimerNode

#label, #timer

Instance Method Summary collapse

Methods inherited from TimerNode

#label_width

Constructor Details

#initialize(timer, label, time) ⇒ TimerElement

Returns a new instance of TimerElement.



23
24
25
26
# File 'lib/pg_graph/timer.rb', line 23

def initialize(timer, label, time)
  super(timer, label)
  @time = time
end

Instance Attribute Details

#timeObject

Returns the value of attribute time.



21
22
23
# File 'lib/pg_graph/timer.rb', line 21

def time
  @time
end

Instance Method Details

#totalObject



31
# File 'lib/pg_graph/timer.rb', line 31

def total() @time end

#valueObject



29
# File 'lib/pg_graph/timer.rb', line 29

def value() @value ||= format time end

#value_widthObject



28
# File 'lib/pg_graph/timer.rb', line 28

def value_width() value.size end