Class: EventTree::Event
- Inherits:
-
Object
- Object
- EventTree::Event
- Defined in:
- lib/agent/event_tree.rb
Instance Attribute Summary collapse
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#endTime ⇒ Object
Returns the value of attribute endTime.
-
#invertEndTime ⇒ Object
Returns the value of attribute invertEndTime.
-
#label ⇒ Object
Returns the value of attribute label.
-
#name ⇒ Object
Returns the value of attribute name.
-
#payload ⇒ Object
Returns the value of attribute payload.
-
#startTime ⇒ Object
Returns the value of attribute startTime.
Instance Method Summary collapse
- #contains(event) ⇒ Object
-
#initialize(name, label, startTime, endTime, payload) ⇒ Event
constructor
A new instance of Event.
Constructor Details
#initialize(name, label, startTime, endTime, payload) ⇒ Event
Returns a new instance of Event.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/agent/event_tree.rb', line 12 def initialize(name, label, startTime, endTime, payload) if startTime > endTime raise "Invalid event, startTime is greater than endTime " + startTime.to_s + "->" + endTime.to_s end @name = name @label = label @startTime = startTime @endTime = endTime @payload = payload @invertEndTime = - endTime.to_f @duration = endTime - startTime end |
Instance Attribute Details
#duration ⇒ Object
Returns the value of attribute duration.
24 25 26 |
# File 'lib/agent/event_tree.rb', line 24 def duration @duration end |
#endTime ⇒ Object
Returns the value of attribute endTime.
24 25 26 |
# File 'lib/agent/event_tree.rb', line 24 def endTime @endTime end |
#invertEndTime ⇒ Object
Returns the value of attribute invertEndTime.
24 25 26 |
# File 'lib/agent/event_tree.rb', line 24 def invertEndTime @invertEndTime end |
#label ⇒ Object
Returns the value of attribute label.
24 25 26 |
# File 'lib/agent/event_tree.rb', line 24 def label @label end |
#name ⇒ Object
Returns the value of attribute name.
24 25 26 |
# File 'lib/agent/event_tree.rb', line 24 def name @name end |
#payload ⇒ Object
Returns the value of attribute payload.
24 25 26 |
# File 'lib/agent/event_tree.rb', line 24 def payload @payload end |
#startTime ⇒ Object
Returns the value of attribute startTime.
24 25 26 |
# File 'lib/agent/event_tree.rb', line 24 def startTime @startTime end |
Instance Method Details
#contains(event) ⇒ Object
26 27 28 |
# File 'lib/agent/event_tree.rb', line 26 def contains(event) event.startTime >= @startTime && event.endTime <= @endTime end |