Commits

Anonymous committed a2bd824

Moosified _enqueue_event and _extract_event into Moosified stuff.

Comments (0)

Files changed (1)

perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/FromProto/Parser/QnD.pm

 has "_curr_line_idx" => (isa => "Int", is => "rw");
 has "_lines" => (isa => "ArrayRef", is => "rw");
 has "_tags_stack" => (isa => "ArrayRef", is => "rw");
-has "_events_queue" => (isa => "ArrayRef", is => "rw", default => sub { []; });
+has "_events_queue" =>
+(
+    isa => "ArrayRef",
+    is => "rw", 
+    default => sub { []; },
+    traits => ['Array'],
+    handles =>
+    {
+        _enqueue_event => 'push',
+        _extract_event => 'shift',
+    },
+);
 has "_in_para" => (isa => "Bool", is => "rw");
 
 use XML::Grammar::Fiction::FromProto::Nodes;
 
 our $VERSION = '0.0.3';
 
-sub _enqueue_event
-{
-    my ($self, $event) = @_;
-   
-    push (@{$self->_events_queue()}, $event);
-}
-
-sub _extract_event
-{
-    my $self = shift;
-
-    return shift(@{$self->_events_queue()});
-}
-
 sub _add_to_top_tag
 {
     my ($self, $child) = @_;