blib/lib/Zuzu/AST/Expr/New.pm

filter: Statementstmt 100% 13 / 13 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 100% 1 / 1 totaltotal 100% 17 / 17 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
evaluate
1.0
CRAP 1.0
« blib/lib/Zuzu/AST/Expr/MemberCall.pm ↑ Summary blib/lib/Zuzu/AST/Expr/Range.pm »
1 package Zuzu::AST::Expr::New;
2  
3 78 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 78 our $VERSION = '0.007002';
6  
7 78 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 78 has 'class_expr' => ( is => 'rw' );
10 78 has 'traits' => ( is => 'rw' );
11 78 has 'args' => ( is => 'rw' );
12  
13 78 with 'Zuzu::AST::Role::Node';
14  
15 5319 ▶sub evaluate { $_[1]->eval_new($_[0]) }
Subroutine evaluate: called CC=1 SCAR=0.0
Pod documented
16  
17 =pod
18  
19 =head1 NAME
20  
21 Zuzu::AST::Expr::New - AST node for object construction expressions
22  
23 =head1 DESCRIPTION
24  
25 Represents a C<new ClassName(...)> expression with named
26 constructor arguments.
27  
28 =head1 INHERITANCE
29  
30 Inherits from C<Moo::Object>.
31  
32 =head1 ROLES
33  
34 Consumes C<Zuzu::AST::Role::Node>.
35  
36 =head1 ATTRIBUTES
37  
38 =head2 class_expr
39  
40 Type: B<Zuzu::AST::Role::Node>.
41  
42 Expression that resolves to the class value being instantiated.
43  
44 =head2 traits
45  
46 Type: B<ArrayRef[Zuzu::AST::Role::Node]>.
47  
48 Optional trait references to compose for this one constructed object.
49  
50 =head2 args
51  
52 Type: B<ArrayRef[ArrayRef]>.
53  
54 Ordered constructor named arguments as C<[ key, expr ]> pairs.
55  
56 =head1 METHODS
57  
58 =head2 evaluate
59  
60 Dispatches this AST node to the matching runtime evaluator.
61  
62 =head1 SEE ALSO
63  
64 C<Zuzu::AST::Role::Node>.
65  
66 Subclasses: none in this distribution.
67  
68 =head1 COPYRIGHT AND LICENCE
69  
70 B<< Zuzu::AST::Expr::New >> is copyright Toby Inkster.
71  
72 It is free software; you may redistribute it and/or modify it under
73 the terms of either the Artistic License 1.0 or the GNU General Public
74 License version 2.
75  
76 =cut
77  
78 78 1;
« blib/lib/Zuzu/AST/Expr/MemberCall.pm ↑ Summary blib/lib/Zuzu/AST/Expr/Range.pm »