Class: TimeQueue::Item
- Inherits:
-
Struct
- Object
- Struct
- TimeQueue::Item
- Defined in:
- lib/argus/time_queue.rb
Instance Attribute Summary collapse
-
#time ⇒ Object
Returns the value of attribute time.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
Instance Attribute Details
#time ⇒ Object
Returns the value of attribute time
2 3 4 |
# File 'lib/argus/time_queue.rb', line 2 def time @time end |
#value ⇒ Object
Returns the value of attribute value
2 3 4 |
# File 'lib/argus/time_queue.rb', line 2 def value @value end |
Instance Method Details
#<=>(other) ⇒ Object
3 4 5 |
# File 'lib/argus/time_queue.rb', line 3 def <=>(other) time <=> other.time end |
#key ⇒ Object
7 8 9 |
# File 'lib/argus/time_queue.rb', line 7 def key object_id end |
#to_s(basetime = nil) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/argus/time_queue.rb', line 11 def to_s(basetime=nil) if basetime "#{value.inspect}@+#{time-basetime}" else "#{value.inspect}@#{time.strftime('%H:%M:%S.%L')}" end end |