Class: Tracebin::Event
- Inherits:
-
Object
- Object
- Tracebin::Event
- Includes:
- Helpers
- Defined in:
- lib/tracebin/events.rb
Direct Known Subclasses
ControllerEvent, CustomEvent, SQLEvent, SinatraEvent, ViewEvent
Instance Attribute Summary collapse
-
#event ⇒ Object
readonly
Returns the value of attribute event.
Instance Method Summary collapse
- #data_hash ⇒ Object
-
#initialize(event) ⇒ Event
constructor
A new instance of Event.
- #recorder_type ⇒ Object
- #valid? ⇒ Boolean
Methods included from Helpers
#deserialize_time_string, #milliseconds_between, #time_to_string, #timestamp_string, #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 (readonly)
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: time_to_string(event[1]), stop: time_to_string(event[2]), duration: milliseconds_between(event[2], event[1]), data: select_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 |