| 1 | package Zuzu::Value::Class; | ||
| 2 | |||
| 3 | 70 | ▶ | use utf8; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 70 | our $VERSION = '0.007002'; | |
| 6 | |||
| 7 | 70 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 70 | has 'name' => ( is => 'rw' ); | |
| 10 | 70 | has 'parent' => ( is => 'rw' ); | |
| 11 | 70 | has 'traits' => ( is => 'rw' ); | |
| 12 | 70 | has 'field_specs' => ( is => 'rw' ); | |
| 13 | 70 | has 'methods' => ( is => 'rw' ); | |
| 14 | 70 | has 'trait_methods' => ( is => 'rw' ); | |
| 15 | 70 | has 'static_methods' => ( is => 'rw' ); | |
| 16 | 70 | has 'nested_classes' => ( is => 'rw' ); | |
| 17 | 70 | has 'closure_env' => ( is => 'rw' ); | |
| 18 | 70 | has 'native_constructor' => ( is => 'rw' ); | |
| 19 | 70 | has 'builtin_kind' => ( is => 'rw' ); | |
| 20 | 70 | has 'source_node' => ( is => 'rw' ); | |
| 21 | |||
| 22 | 40 | ▶ | sub is_truthy { 1 } |
|
Subroutine
is_truthy: called CC=1 SCAR=0.0
Pod
documented
| |||
| 23 | |||
| 24 | =pod | ||
| 25 | |||
| 26 | =head1 NAME | ||
| 27 | |||
| 28 | Zuzu::Value::Class - runtime value class for class values | ||
| 29 | |||
| 30 | =head1 DESCRIPTION | ||
| 31 | |||
| 32 | Represents class metadata needed for instantiation, inheritance, | ||
| 33 | and static dispatch. | ||
| 34 | |||
| 35 | =head1 INHERITANCE | ||
| 36 | |||
| 37 | Inherits from C<Moo::Object>. | ||
| 38 | |||
| 39 | =head1 ROLES | ||
| 40 | |||
| 41 | None. | ||
| 42 | |||
| 43 | =head1 ATTRIBUTES | ||
| 44 | |||
| 45 | =head2 name | ||
| 46 | |||
| 47 | Type: B<Str>. | ||
| 48 | |||
| 49 | Identifier name declared or referenced by the node/value. | ||
| 50 | |||
| 51 | =head2 parent | ||
| 52 | |||
| 53 | Type: B<Maybe[InstanceOf["Zuzu::Value::Class"]]>. | ||
| 54 | |||
| 55 | Optional parent class used for inheritance lookups. | ||
| 56 | |||
| 57 | =head2 traits | ||
| 58 | |||
| 59 | Type: B<ArrayRef[InstanceOf["Zuzu::Value::Trait"]]>. | ||
| 60 | |||
| 61 | Trait values composed into this class. | ||
| 62 | |||
| 63 | =head2 field_specs | ||
| 64 | |||
| 65 | Type: B<ArrayRef[HashRef]>. | ||
| 66 | |||
| 67 | Field declaration metadata inherited during object creation. | ||
| 68 | |||
| 69 | =head2 methods | ||
| 70 | |||
| 71 | Type: B<HashRef[InstanceOf["Zuzu::Value::Function"]]>. | ||
| 72 | |||
| 73 | Instance method table for this class. | ||
| 74 | |||
| 75 | =head2 trait_methods | ||
| 76 | |||
| 77 | Type: B<HashRef[ArrayRef[InstanceOf["Zuzu::Value::Function"]]]>. | ||
| 78 | |||
| 79 | Trait-provided instance methods grouped by method name and preserved | ||
| 80 | in trait composition order. | ||
| 81 | |||
| 82 | =head2 static_methods | ||
| 83 | |||
| 84 | Type: B<HashRef[InstanceOf["Zuzu::Value::Function"]]>. | ||
| 85 | |||
| 86 | Static method table for this class. | ||
| 87 | |||
| 88 | =head2 nested_classes | ||
| 89 | |||
| 90 | Type: B<HashRef[InstanceOf["Zuzu::Value::Class"]]>. | ||
| 91 | |||
| 92 | Nested class table scoped beneath this class. | ||
| 93 | |||
| 94 | =head2 closure_env | ||
| 95 | |||
| 96 | Type: B<Maybe[InstanceOf["Zuzu::Env"]]>. | ||
| 97 | |||
| 98 | Lexical environment captured when the class is declared. | ||
| 99 | |||
| 100 | =head2 source_node | ||
| 101 | |||
| 102 | Type: B<Maybe[InstanceOf["Zuzu::AST::Stmt::Class"]]>. | ||
| 103 | |||
| 104 | Original class declaration AST, retained for source extraction. | ||
| 105 | |||
| 106 | =head1 METHODS | ||
| 107 | |||
| 108 | =head2 is_truthy | ||
| 109 | |||
| 110 | Returns this runtime value's truthiness in ZuzuScript. | ||
| 111 | |||
| 112 | =head1 SEE ALSO | ||
| 113 | |||
| 114 | Subclasses: none in this distribution. | ||
| 115 | |||
| 116 | =head1 COPYRIGHT AND LICENCE | ||
| 117 | |||
| 118 | B<< Zuzu::Value::Class >> is copyright Toby Inkster. | ||
| 119 | |||
| 120 | It is free software; you may redistribute it and/or modify it under | ||
| 121 | the terms of either the Artistic License 1.0 or the GNU General Public | ||
| 122 | License version 2. | ||
| 123 | |||
| 124 | =cut | ||
| 125 | |||
| 126 | 70 | 1; | |