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



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

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

.columnsObject



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

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