File Coverage

blib/lib/SignalWire/Agents/Contexts/ContextBuilder.pm
Criterion Covered Total %
statement 17 17 100.0
branch 2 2 100.0
condition n/a
subroutine 6 6 100.0
pod 0 3 0.0
total 25 28 89.2


line stmt bran cond sub pod time code
1             package SignalWire::Agents::Contexts::ContextBuilder;
2             # Copyright (c) 2025 SignalWire
3             # Licensed under the MIT License.
4             # Stub: full implementation provided by another agent.
5              
6 16     16   130 use strict;
  16         29  
  16         893  
7 16     16   133 use warnings;
  16         43  
  16         1076  
8 16     16   93 use Moo;
  16         31  
  16         183  
9              
10             has _contexts => (is => 'rw', default => sub { {} });
11              
12             sub add_context {
13 2     2 0 389 my ($self, $name, %opts) = @_;
14 2         13 $self->_contexts->{$name} = \%opts;
15 2         7 return $self;
16             }
17              
18             sub has_contexts {
19 71     71 0 601 my ($self) = @_;
20 71 100       123 return scalar(keys %{ $self->_contexts }) ? 1 : 0;
  71         552  
21             }
22              
23             sub to_hashref {
24 1     1 0 8 my ($self) = @_;
25 1         7 return $self->_contexts;
26             }
27              
28             1;