Class: Vizsla::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/vizsla/subscribers.rb

Direct Known Subclasses

ControllerEvent, SQLEvent, ViewEvent

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event) ⇒ Event

Returns a new instance of Event.



8
9
10
# File 'lib/vizsla/subscribers.rb', line 8

def initialize(event)
  @event = event
end

Instance Attribute Details

#eventObject (readonly)

Returns the value of attribute event.



6
7
8
# File 'lib/vizsla/subscribers.rb', line 6

def event
  @event
end

Instance Method Details

#prettify_dataObject



20
21
22
23
24
25
26
27
# File 'lib/vizsla/subscribers.rb', line 20

def prettify_data
  {
    event_started: event[1],
    event_ended: event[2],
    event_duration: event[2] - event[1],
    event_payload: prettify_payload
  }
end

#recorder_typeObject



12
13
14
# File 'lib/vizsla/subscribers.rb', line 12

def recorder_type
  event[0]
end

#valid?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/vizsla/subscribers.rb', line 16

def valid?
  true
end