| 1 | package Zuzu::Value::Trait; | ||
| 2 | |||
| 3 | 69 | ▶ | use utf8; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 69 | our $VERSION = '0.007002'; | |
| 6 | |||
| 7 | 69 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 69 | has 'name' => ( is => 'rw' ); | |
| 10 | 69 | has 'methods' => ( is => 'rw' ); | |
| 11 | 69 | has 'closure_env' => ( is => 'rw' ); | |
| 12 | 69 | has 'source_node' => ( is => 'rw' ); | |
| 13 | |||
| 14 | 0 | ▶ | sub is_truthy { 1 } |
|
Subroutine
is_truthy: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 15 | |||
| 16 | =pod | ||
| 17 | |||
| 18 | =head1 NAME | ||
| 19 | |||
| 20 | Zuzu::Value::Trait - runtime value class for trait values | ||
| 21 | |||
| 22 | =head1 DESCRIPTION | ||
| 23 | |||
| 24 | Represents trait metadata and method definitions used for class | ||
| 25 | composition. | ||
| 26 | |||
| 27 | =head1 INHERITANCE | ||
| 28 | |||
| 29 | Inherits from C<Moo::Object>. | ||
| 30 | |||
| 31 | =head1 ROLES | ||
| 32 | |||
| 33 | None. | ||
| 34 | |||
| 35 | =head1 ATTRIBUTES | ||
| 36 | |||
| 37 | =head2 name | ||
| 38 | |||
| 39 | Type: B<Str>. | ||
| 40 | |||
| 41 | Identifier name declared or referenced by the node/value. | ||
| 42 | |||
| 43 | =head2 methods | ||
| 44 | |||
| 45 | Type: B<HashRef[InstanceOf["Zuzu::Value::Function"]]>. | ||
| 46 | |||
| 47 | Method table provided by this trait. | ||
| 48 | |||
| 49 | =head2 closure_env | ||
| 50 | |||
| 51 | Type: B<Maybe[InstanceOf["Zuzu::Env"]]>. | ||
| 52 | |||
| 53 | Lexical environment captured when the trait is declared. | ||
| 54 | |||
| 55 | =head2 source_node | ||
| 56 | |||
| 57 | Type: B<Maybe[InstanceOf["Zuzu::AST::Stmt::Trait"]]>. | ||
| 58 | |||
| 59 | Original trait declaration AST, retained for source extraction. | ||
| 60 | |||
| 61 | =head1 METHODS | ||
| 62 | |||
| 63 | =head2 is_truthy | ||
| 64 | |||
| 65 | Returns this runtime value's truthiness in ZuzuScript. | ||
| 66 | |||
| 67 | =head1 SEE ALSO | ||
| 68 | |||
| 69 | Subclasses: none in this distribution. | ||
| 70 | |||
| 71 | =head1 COPYRIGHT AND LICENCE | ||
| 72 | |||
| 73 | B<< Zuzu::Value::Trait >> is copyright Toby Inkster. | ||
| 74 | |||
| 75 | It is free software; you may redistribute it and/or modify it under | ||
| 76 | the terms of either the Artistic License 1.0 or the GNU General Public | ||
| 77 | License version 2. | ||
| 78 | |||
| 79 | =cut | ||
| 80 | |||
| 81 | 69 | 1; | |