File Coverage

blib/lib/Bb/Collaborate/Ultra/LaunchContext.pm
Criterion Covered Total %
statement 12 20 60.0
branch 0 2 0.0
condition 0 3 0.0
subroutine 4 5 80.0
pod 1 1 100.0
total 17 31 54.8


line stmt bran cond sub pod time code
1             package Bb::Collaborate::Ultra::LaunchContext;
2 1     1   794 use warnings; use strict;
  1     1   1  
  1         31  
  1         4  
  1         2  
  1         17  
3 1     1   2 use Mouse;
  1         1  
  1         6  
4             extends 'Bb::Collaborate::Ultra::DAO';
5 1     1   299 use Bb::Collaborate::Ultra::User;
  1         2  
  1         138  
6             has 'user' => (isa => 'Bb::Collaborate::Ultra::User', is => 'rw', coerce => 1);
7              
8             =head1 NAME
9              
10             Bb::Collaborate::Ultra::LaunchContext - Session Launch Context
11              
12             =head1 DESCRIPTION
13              
14             This class is used to construct details for joining a session,
15             including user identification and permissions.
16              
17             my $user = Bb::Collaborate::Ultra::User->new({
18             extId => 'testLaunchUser',
19             displayName => 'David Warring',
20             email => 'david.warring@gmail.com',
21             firstName => 'David',
22             lastName => 'Warring',
23             });
24              
25             my $launch_context = Bb::Collaborate::Ultra::LaunchContext->new({ launchingRole => 'moderator',
26             editingPermission => 'writer',
27             user => $user,
28             });
29              
30             =head1 METHODS
31              
32             See L.
33              
34             =cut
35            
36             =head2 join_session
37              
38             my $join_url = $launch_context->join_session($session);
39              
40             Obtain a url to join a particular session.
41              
42             =cut
43              
44              
45             sub join_session {
46 0     0 1   my $self = shift;
47 0           my $session = shift;
48 0 0 0       my $connection = shift || $session->connection
49             or die "not connected";
50 0           my $session_path = $session->path.'/url';
51 0           my $data = $self->_freeze;
52 0           my $response = $connection->POST($session_path, $data);
53 0           my $msg = $response;
54 0           $msg->{url};
55             }
56              
57             __PACKAGE__->load_schema();
58             1;
59             # downloaded from https://xx-csa.bbcollab.com/documentation
60             __DATA__