Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix tab damage.

  • Loading branch information...
commit e37fb970426a7c0afc76efbd2c87656dd6aa2d99 1 parent 632701e
@rcaputo authored
Showing with 38 additions and 38 deletions.
  1. +38 −38 docs/eg-10-setup.pl
View
76 docs/eg-10-setup.pl
@@ -1,51 +1,51 @@
#!/usr/bin/perl
{
- package Counter;
- use Moose;
- extends 'Stage';
- use Delay;
- use ObserverTrait;
- use EmitterTrait;
-
- has count => (
- traits => ['Emitter'],
- isa => 'Int',
- is => 'rw',
- default => 0,
- );
-
- has ticker => (
- traits => ['Observer'],
- isa => 'Delay',
- is => 'rw',
- setup => sub { Delay->new( interval => 1, auto_repeat => 1 ) },
- );
-
- sub on_ticker_tick {
- my $self = shift;
- $self->count($self->count() + 1);
- }
+ package Counter;
+ use Moose;
+ extends 'Stage';
+ use Delay;
+ use ObserverTrait;
+ use EmitterTrait;
+
+ has count => (
+ traits => ['Emitter'],
+ isa => 'Int',
+ is => 'rw',
+ default => 0,
+ );
+
+ has ticker => (
+ traits => ['Observer'],
+ isa => 'Delay',
+ is => 'rw',
+ setup => sub { Delay->new( interval => 1, auto_repeat => 1 ) },
+ );
+
+ sub on_ticker_tick {
+ my $self = shift;
+ $self->count($self->count() + 1);
+ }
}
{
- package Watcher;
- use Moose;
- extends 'Stage';
+ package Watcher;
+ use Moose;
+ extends 'Stage';
- has counter => (
- traits => ['Observer'],
- isa => 'Counter|Undef',
- is => 'rw',
- setup => sub { Counter->new() },
- );
+ has counter => (
+ traits => ['Observer'],
+ isa => 'Counter|Undef',
+ is => 'rw',
+ setup => sub { Counter->new() },
+ );
- sub on_counter_count {
- my ($self, $args) = @_;
- warn "Watcher sees counter count: $args->{value}\n";
+ sub on_counter_count {
+ my ($self, $args) = @_;
+ warn "Watcher sees counter count: $args->{value}\n";
$self->counter(undef) if $args->{value} >= 5;
- }
+ }
}
my $w = Watcher->new();
Please sign in to comment.
Something went wrong with that request. Please try again.