POE/Meta/Trait/Instance.pm

filter: Statementstmt 80.0% 24 / 30 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 72.7% 8 / 11 Podpod 100% 6 / 6 totaltotal 77.5% 38 / 49 CC 2 SCAR 6.9
CC
2
Cov
75%
is_slot_initialized
6.0
get_slot_value
2.0
weaken_slot_value
2.0
CRAP 2.0
« POE/Meta/Trait/Class.pm ↑ Summary POE/Meta/Trait.pm »
1 package MooseX::POE::Meta::Trait::Instance;
2 {
3 16 $MooseX::POE::Meta::Trait::Instance::VERSION = '0.215';
4 }
5 # ABSTRACT: A Instance Metaclass for MooseX::POE
6  
7 16 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 16 ▶use POE;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 16 ▶use Scalar::Util ();
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 109 ▶sub get_session_id {
Subroutine get_session_id: called CC=1 SCAR=0.0
Pod documented
13 109 my ( $self, $instance ) = @_;
14 109 return $instance->{session_id};
15 }
16  
17 0 ▶sub get_slot_value {
Subroutine get_slot_value: not called CC=1 SCAR=6.9
Pod documented
18 0 my ( $self, $instance, $slot_name ) = @_;
19 0 return $instance->{heap}{$slot_name};
20 }
21  
22 46 ▶sub set_slot_value {
Subroutine set_slot_value: called CC=1 SCAR=0.0
Pod documented
23 46 my ( $self, $instance, $slot_name, $value ) = @_;
24 46 $instance->{heap}{$slot_name} = $value;
25 }
26  
27 0 ▶sub is_slot_initialized {
Subroutine is_slot_initialized: not called CC=2 SCAR=17.9
Pod documented
28 0 my ( $self, $instance, $slot_name, $value ) = @_;
29 0 ▶ exists $instance->{heap}{$slot_name} ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
exists $instance->{'heap'}{$slot_name} ? : 0 0 0
30 }
31  
32 0 ▶sub weaken_slot_value {
Subroutine weaken_slot_value: not called CC=1 SCAR=6.9
Pod documented
33 0 my ( $self, $instance, $slot_name ) = @_;
34 0 Scalar::Util::weaken( $instance->{heap}{$slot_name} );
35 }
36  
37 31 ▶sub inline_slot_access {
Subroutine inline_slot_access: called CC=1 SCAR=0.0
Pod documented
38 31 my ( $self, $instance, $slot_name ) = @_;
39 31 sprintf '%s->{heap}{%s}', $instance, $slot_name;
40 }
41  
42 16 ▶no POE;
Subroutine BEGIN: called CC=1 SCAR=0.0
43 16 ▶no Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
44 16 1;
45  
46  
47 =pod
48  
49 =head1 NAME
50  
51 MooseX::POE::Meta::Trait::Instance - A Instance Metaclass for MooseX::POE
52  
53 =head1 VERSION
54  
55 version 0.215
56  
57 =head1 SYNOPSIS
58  
59 Moose::Util::MetaRole::apply_metaclass_roles(
60 for_class => $for_class,
61 metaclass_roles => [
62 'MooseX::POE::Meta::Trait::Class'
63 ],
64 instance_metaclass_roles => [
65 'MooseX::POE::Meta::Trait::Instance',
66 ],
67 );
68  
69 =head1 DESCRIPTION
70  
71 A metaclass for MooseX::POE. This module is only of use to developers
72 so there is no user documentation provided.
73  
74 =head1 METHODS
75  
76 =head2 create_instance
77  
78 =head2 get_slot_value
79  
80 =head2 inline_slot_access
81  
82 =head2 is_slot_initialized
83  
84 =head2 set_slot_value
85  
86 =head2 weaken_slot_value
87  
88 =head2 get_session_id
89  
90 =head1 METHODS
91  
92 =head1 AUTHORS
93  
94 =over 4
95  
96 =item *
97  
98 Chris Prather <chris@prather.org>
99  
100 =item *
101  
102 Ash Berlin <ash@cpan.org>
103  
104 =item *
105  
106 Chris Williams <chris@bingosnet.co.uk>
107  
108 =item *
109  
110 Yuval (nothingmuch) Kogman
111  
112 =item *
113  
114 Torsten Raudssus <torsten@raudssus.de> L<http://www.raudssus.de/>
115  
116 =back
117  
118 =head1 COPYRIGHT AND LICENSE
119  
120 This software is copyright (c) 2010 by Chris Prather, Ash Berlin, Chris Williams, Yuval Kogman, Torsten Raudssus.
121  
122 This is free software; you can redistribute it and/or modify it under
123 the same terms as the Perl 5 programming language system itself.
124  
125 =cut
126  
127  
128 __END__
« POE/Meta/Trait/Class.pm ↑ Summary POE/Meta/Trait.pm »