Class: ThinkFeelDoEngine::Reports::Event

Inherits:
Object
  • Object
show all
Defined in:
app/models/think_feel_do_engine/reports/event.rb

Overview

Scenario: a Participant clicks, causes a page to render, starts/pauses/finishes a video, etc.

Class Method Summary collapse

Class Method Details

.allObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/models/think_feel_do_engine/reports/event.rb', line 11

def self.all
  Participant.not_moderator
             .select(:id, :study_id, :is_admin).map do |participant|
    EventCapture::Event.where(participant_id: participant.id)
                       .map do |event|
      {
        participant_id: participant.study_id,
        is_admin: participant.is_admin,
        emitted_at: event.emitted_at.iso8601,
        current_url: event.current_url,
        headers: event.headers,
        kind: event.kind
      }
    end
  end.flatten
end

.columnsObject



7
8
9
# File 'app/models/think_feel_do_engine/reports/event.rb', line 7

def self.columns
  %w( participant_id is_admin emitted_at current_url headers kind )
end