| 1 | 50 | ▶ | use v5.14; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 50 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | =head1 NAME | ||||||||||
| 5 | |||||||||||
| 6 | Attean::Quad - RDF Quads | ||||||||||
| 7 | |||||||||||
| 8 | =head1 VERSION | ||||||||||
| 9 | |||||||||||
| 10 | This document describes Attean::Quad version 0.040 | ||||||||||
| 11 | |||||||||||
| 12 | =head1 SYNOPSIS | ||||||||||
| 13 | |||||||||||
| 14 | use v5.14; | ||||||||||
| 15 | use Attean; | ||||||||||
| 16 | my $quad = Attean::Quad->new( $s, $p, $o, $g ); | ||||||||||
| 17 | |||||||||||
| 18 | =head1 DESCRIPTION | ||||||||||
| 19 | |||||||||||
| 20 | The Attean::Quad class represents an RDF quad. | ||||||||||
| 21 | It conforms to the L<Attean::API::Quad|Attean::API::Binding> role. | ||||||||||
| 22 | |||||||||||
| 23 | =head1 ROLES | ||||||||||
| 24 | |||||||||||
| 25 | This class consumes L<Attean::API::Quad>. | ||||||||||
| 26 | |||||||||||
| 27 | =head1 METHODS | ||||||||||
| 28 | |||||||||||
| 29 | =over 4 | ||||||||||
| 30 | |||||||||||
| 31 | =item C<< subject >> | ||||||||||
| 32 | |||||||||||
| 33 | =item C<< predicate >> | ||||||||||
| 34 | |||||||||||
| 35 | =item C<< object >> | ||||||||||
| 36 | |||||||||||
| 37 | =item C<< graph >> | ||||||||||
| 38 | |||||||||||
| 39 | =back | ||||||||||
| 40 | |||||||||||
| 41 | =cut | ||||||||||
| 42 | |||||||||||
| 43 | 50 | package Attean::QuadPattern 0.040 { | |||||||||
| 44 | 50 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 45 | 50 | ▶ | use Scalar::Util qw(blessed); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 46 | 50 | ▶ | use Attean::RDF; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 47 | 50 | ▶ | use Attean::API::Binding; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 48 | |||||||||||
| 49 | 50 | has 'subject' => (is => 'ro', required => 1); | |||||||||
| 50 | 50 | has 'predicate' => (is => 'ro', required => 1); | |||||||||
| 51 | 50 | has 'object' => (is => 'ro', required => 1); | |||||||||
| 52 | 50 | has 'graph' => (is => 'ro', required => 1); | |||||||||
| 53 | |||||||||||
| 54 | 50 | with 'Attean::API::QuadPattern'; | |||||||||
| 55 | } | ||||||||||
| 56 | |||||||||||
| 57 | 50 | package Attean::Quad 0.040 { | |||||||||
| 58 | 50 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 59 | 50 | ▶ | use Attean::API::Binding; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 60 | |||||||||||
| 61 | 50 | has 'subject' => (is => 'ro', does => 'Attean::API::BlankOrIRI', required => 1); | |||||||||
| 62 | 50 | has 'predicate' => (is => 'ro', does => 'Attean::API::IRI', required => 1); | |||||||||
| 63 | 50 | has 'object' => (is => 'ro', does => 'Attean::API::Term', required => 1); | |||||||||
| 64 | 50 | has 'graph' => (is => 'ro', does => 'Attean::API::BlankOrIRI', required => 1); | |||||||||
| 65 | |||||||||||
| 66 | 50 | with 'Attean::API::Quad'; | |||||||||
| 67 | |||||||||||
| 68 | 348 | ▶ | around BUILDARGS => sub { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||
| 69 | 348 | my $orig = shift; | |||||||||
| 70 | 348 | my $class = shift; | |||||||||
| 71 | 348 | ▶ | if (scalar(@_) == 4) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 72 | 215 | my %args; | |||||||||
| 73 | 215 | @args{ $class->variables } = @_; | |||||||||
| 74 | 215 | return $class->$orig(%args); | |||||||||
| 75 | } | ||||||||||
| 76 | 133 | return $class->$orig(@_); | |||||||||
| 77 | 50 | }; | |||||||||
| 78 | } | ||||||||||
| 79 | |||||||||||
| 80 | 50 | 1; | |||||||||
| 81 | |||||||||||
| 82 | __END__ | ||||||||||