File: POEState.pm

package info (click to toggle)
libpoex-role-sessioninstantiation-perl 1.101040-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 184 kB
  • ctags: 10
  • sloc: perl: 460; makefile: 4
file content (104 lines) | stat: -rw-r--r-- 2,236 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
package POEx::Role::SessionInstantiation::Meta::POEState;
BEGIN {
  $POEx::Role::SessionInstantiation::Meta::POEState::VERSION = '1.101040';
}

use MooseX::Declare;

#ABSTRACT: A read-only object that provides POE context

class POEx::Role::SessionInstantiation::Meta::POEState
{
    use POEx::Types(':all');
    use MooseX::Types::Moose('Maybe', 'Str');


    has sender  => ( is => 'ro', isa => Kernel|Session|DoesSessionInstantiation);
    

    has state   => ( is => 'ro', isa => Str );


    has kernel  => ( is => 'ro', isa => Kernel );


    has file    => ( is => 'ro', isa => Maybe[Str] );
    has line    => ( is => 'ro', isa => Maybe[Str] );
    has from    => ( is => 'ro', isa => Maybe[Str] );


    method clone
    {
        return $self->meta->clone_object($self);
    }
}

1;



=pod

=head1 NAME

POEx::Role::SessionInstantiation::Meta::POEState - A read-only object that provides POE context

=head1 VERSION

version 1.101040

=head1 PUBLIC_ATTRIBUTES

=head2 sender 

    is: ro, isa: Kernel|Session|DoesSessionInstantiation

The sender of the current event can be access from here. Semantically the same
as $_[+SENDER].

=head2 state

    is: ro, isa => Str

The state fired. This should match the current method name (unless of course
within the _default event handler, then it will be the event name that was 
invoked but did not exist in your object instance.

=head2 kernel

    is: ro, isa: Kernel

This is actually the POE::Kernel singleton provided as a little sugar instead
of requiring use of $poe_kernel, etc. To make sure you are currently within a 
POE context, check this attribute for definedness.

=head2 [qw/file line from/] 

    is: rw, isa: Maybe[Str]

These attributes provide tracing information from within POE. From is actually
not used in POE::Session as far as I can tell, but it is available just in 
case.

=head1 PROTECTED_METHODS

=head2 clone

Clones the current POEState object and returns it

=head1 AUTHOR

  Nicholas Perez <nperez@cpan.org>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2010 by Nicholas Perez.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut


__END__