| 1 | package Bb::Collaborate::Ultra::Session::Log; | ||||||||||||||||||||
| 2 | 1 | ▶ | use warnings; use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 1 | ▶ | use Mouse; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 1 | ▶ | use JSON; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 1 | extends 'Bb::Collaborate::Ultra::DAO'; | |||||||||||||||||||
| 6 | 1 | ▶ | use Mouse::Util::TypeConstraints; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | =head1 NAME | ||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | Bb::Collaborate::Ultra::Session::Log | ||||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | =head1 DESCRIPTION | ||||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | Session logging class. | ||||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | =head1 EXAMPLE | ||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | my @sessions = Bb::Collaborate::Ultra::Session->get($connection, {contextId => $context_id}); | ||||||||||||||||||||
| 19 | for my $session (@sessions) { | ||||||||||||||||||||
| 20 | print "Session: ". $session->name . "\n"; | ||||||||||||||||||||
| 21 | my @logs = $session->logs; | ||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | for my $log (@logs) { | ||||||||||||||||||||
| 24 | say "\tOpened: " .(scalar localtime $log->opened); | ||||||||||||||||||||
| 25 | for my $attendee ($log->attendees) { | ||||||||||||||||||||
| 26 | my $first_join; | ||||||||||||||||||||
| 27 | my $elapsed = 0; | ||||||||||||||||||||
| 28 | for my $attendance (@{$attendee->attendance}) { | ||||||||||||||||||||
| 29 | my $joined = $attendance->joined; | ||||||||||||||||||||
| 30 | $first_join = $joined | ||||||||||||||||||||
| 31 | if !$first_join || $first_join > $joined; | ||||||||||||||||||||
| 32 | $elapsed += $attendance->left - $joined; | ||||||||||||||||||||
| 33 | } | ||||||||||||||||||||
| 34 | say sprintf("\tUser %s (%s) joined at %s, stayed %d minutes", $attendee->externalUserId, $attendee->displayName, (scalar localtime $first_join), $elapsed / 60); | ||||||||||||||||||||
| 35 | } | ||||||||||||||||||||
| 36 | say "\tClosed: " .(scalar localtime $log->closed); | ||||||||||||||||||||
| 37 | } | ||||||||||||||||||||
| 38 | } | ||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | =head1 METHODS | ||||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | This class supports the `get` method as described in L<https://xx-csa.bbcollab.com/documentation#Attendee-collection>. | ||||||||||||||||||||
| 43 | |||||||||||||||||||||
| 44 | =cut | ||||||||||||||||||||
| 45 | |||||||||||||||||||||
| 46 | coerce __PACKAGE__, from 'HashRef' => via { | ||||||||||||||||||||
| 47 | 0 | ▶ | __PACKAGE__->new( $_ ) | ||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 48 | 1 | }; | |||||||||||||||||||
| 49 | |||||||||||||||||||||
| 50 | 1 | __PACKAGE__->resource('instances'); | |||||||||||||||||||
| 51 | 1 | __PACKAGE__->load_schema(<DATA>); | |||||||||||||||||||
| 52 | |||||||||||||||||||||
| 53 | =head2 attendees | ||||||||||||||||||||
| 54 | |||||||||||||||||||||
| 55 | Logs individual attendances for this session. | ||||||||||||||||||||
| 56 | |||||||||||||||||||||
| 57 | =cut | ||||||||||||||||||||
| 58 | |||||||||||||||||||||
| 59 | sub attendees { | ||||||||||||||||||||
| 60 | 0 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
attendees: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||
| 61 | 0 | ▶ | my $connection = shift || $self->connection; | ||||||||||||||||||
|
Condition0%0/3
shift() || $self->connection
MC/DC0%0/2
shift() || $self->connection
shift()
$self->connection
Truth table0%0/3
A || B
A= shift()B= $self->connection
| |||||||||||||||||||||
| 62 | 0 | my $path = $self->path.'/attendees'; | |||||||||||||||||||
| 63 | 0 | require Bb::Collaborate::Ultra::Session::Log::Attendee; | |||||||||||||||||||
| 64 | 0 | Bb::Collaborate::Ultra::Session::Log::Attendee->get($connection => {}, path => $path, parent => $self); | |||||||||||||||||||
| 65 | } | ||||||||||||||||||||
| 66 | |||||||||||||||||||||
| 67 | # **NOT DOCUMENTED** in https://xx-csa.bbcollab.com/documentation | ||||||||||||||||||||
| 68 | # schema has been reversed engineered | ||||||||||||||||||||
| 69 | 1 | 1; | |||||||||||||||||||
| 70 | __DATA__ | ||||||||||||||||||||