« 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
| |||||||||||
| 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; | |||||||||