1 |
package Continuity::Coro::Moose; |
package Frey::Web::Field; |
2 |
|
|
3 |
use Moose::Role; |
use Moose::Role; |
4 |
use Coro::Generator; |
use Coro::Generator; |
5 |
|
use Data::UUID; |
6 |
|
|
7 |
has 'cont' => (is => 'rw'); |
has 'cont' => (is => 'rw'); |
8 |
has 'output' => (is => 'rw'); |
has 'output' => (is => 'rw'); |
9 |
has 'input' => (is => 'rw'); |
has 'input' => (is => 'rw'); |
10 |
|
|
11 |
|
has 'uuid' => ( |
12 |
|
is => 'ro', |
13 |
|
isa => 'Str', |
14 |
|
default => sub { Data::UUID->new->create_str } |
15 |
|
); |
16 |
|
|
17 |
|
=head2 field_name |
18 |
|
|
19 |
|
Given a name generate a unique field ID |
20 |
|
|
21 |
|
my $unique_id = $o->field_name( $name ); |
22 |
|
|
23 |
|
=cut |
24 |
|
|
25 |
|
sub field_name { |
26 |
|
my ($self, $name) = @_; |
27 |
|
return $self->uuid . '-' . $name; |
28 |
|
} |
29 |
|
|
30 |
sub process { |
sub process { |
31 |
my ($self, $input) = @_; |
my ($self, $input) = @_; |
32 |
$self->input($input); |
$self->input($input); |