Class: Tracebin::Event
- Inherits:
-
Object
show all
- Includes:
- Helpers
- Defined in:
- lib/tracebin/events.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Helpers
#to_milliseconds
Constructor Details
#initialize(event) ⇒ Event
Returns a new instance of Event.
9
10
11
|
# File 'lib/tracebin/events.rb', line 9
def initialize(event)
@event = event
end
|
Instance Attribute Details
#event ⇒ Object
Returns the value of attribute event.
7
8
9
|
# File 'lib/tracebin/events.rb', line 7
def event
@event
end
|
Instance Method Details
#data_hash ⇒ Object
21
22
23
24
25
26
27
28
29
|
# File 'lib/tracebin/events.rb', line 21
def data_hash
{
event_type: type,
start: event[1],
stop: event[2],
duration: to_milliseconds(event[2] - event[1]),
data: event.last
}
end
|
#recorder_type ⇒ Object
13
14
15
|
# File 'lib/tracebin/events.rb', line 13
def recorder_type
event[0]
end
|
#valid? ⇒ Boolean
17
18
19
|
# File 'lib/tracebin/events.rb', line 17
def valid?
true
end
|