| 1 | # Copyright (c) 2024-2026 Philipp Schafft | ||||||||||
| 2 | |||||||||||
| 3 | # licensed under Artistic License 2.0 (see LICENSE file) | ||||||||||
| 4 | |||||||||||
| 5 | # ABSTRACT: Work with Tag databases | ||||||||||
| 6 | |||||||||||
| 7 | package Data::TagDB::Link; | ||||||||||
| 8 | |||||||||||
| 9 | 4 | ▶ | use v5.10; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 4 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | 4 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | |||||||||||
| 15 | 4 | ▶ | use parent 'Data::TagDB::Base'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | |||||||||||
| 17 | 4 | our $VERSION = v0.16; | |||||||||
| 18 | |||||||||||
| 19 | |||||||||||
| 20 | |||||||||||
| 21 | #@returns Data::TagDB::Tag | ||||||||||
| 22 | 0 | ▶ | sub tag { | ||||||||
|
Subroutine
tag: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 23 | 0 | my ($self) = @_; | |||||||||
| 24 | 0 | return $self->{tag}; | |||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | #@returns Data::TagDB::Tag | ||||||||||
| 28 | 0 | ▶ | sub relation { | ||||||||
|
Subroutine
relation: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 29 | 0 | my ($self) = @_; | |||||||||
| 30 | 0 | return $self->{relation}; | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | #@returns Data::TagDB::Tag | ||||||||||
| 34 | 0 | ▶ | sub context { | ||||||||
|
Subroutine
context: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 35 | 0 | my ($self) = @_; | |||||||||
| 36 | 0 | return $self->{context}; | |||||||||
| 37 | } | ||||||||||
| 38 | |||||||||||
| 39 | # ---- Private helpers ---- | ||||||||||
| 40 | |||||||||||
| 41 | 0 | ▶ | sub _new { | ||||||||
|
Subroutine
_new: not called CC=3 SCAR=24.8
| |||||||||||
| 42 | 0 | my ($pkg, %opts) = @_; | |||||||||
| 43 | |||||||||||
| 44 | 0 | foreach my $required (qw(db tag relation)) { | |||||||||
| 45 | 0 | ▶ | croak 'Missing required member: '.$required unless defined $opts{$required}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 46 | } | ||||||||||
| 47 | |||||||||||
| 48 | 0 | return bless \%opts, $pkg; | |||||||||
| 49 | } | ||||||||||
| 50 | |||||||||||
| 51 | 4 | 1; | |||||||||
| 52 | |||||||||||
| 53 | __END__ | ||||||||||