blib/lib/SignalWire/Agents/Contexts/ContextBuilder.pm

filter: Statementstmt 100% 20 / 20 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 3 totaltotal 90.6% 29 / 32 CC 2 SCAR 2.2
CC
2
Cov
100%
has_contexts
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« blib/lib/SignalWire/Agents/REST/Namespaces/PubSub.pm ↑ Summary blib/lib/SignalWire/Agents/Skills/Builtin/WebSearch.pm »
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 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 16 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 16 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 71 ▶has _contexts => (is => 'rw', default => sub { {} });
Subroutine __ANON__: called CC=1 SCAR=0.0
11  
12 2 ▶sub add_context {
Subroutine add_context: called CC=1 SCAR=0.0
Pod undocumented
13 2 my ($self, $name, %opts) = @_;
14 2 $self->_contexts->{$name} = \%opts;
15 2 return $self;
16 }
17  
18 71 ▶sub has_contexts {
Subroutine has_contexts: called CC=2 SCAR=6.9
Pod undocumented
19 71 my ($self) = @_;
20 71 ▶ return scalar(keys %{ $self->_contexts }) ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
scalar keys %{$self->_contexts;} ? : 2 69 71
21 }
22  
23 1 ▶sub to_hashref {
Subroutine to_hashref: called CC=1 SCAR=0.0
Pod undocumented
24 1 my ($self) = @_;
25 1 return $self->_contexts;
26 }
27  
28 16 1;
« blib/lib/SignalWire/Agents/REST/Namespaces/PubSub.pm ↑ Summary blib/lib/SignalWire/Agents/Skills/Builtin/WebSearch.pm »