5 has type => (is => 'ro', required => 1);
6 has data => (is => 'ro', required => 1);
8 sub flatten { $_[0]->type, @{$_[0]->data} }
10 sub is_success { $_[0]->type eq 'success' }
14 $self->throw unless $self->is_success;
15 return wantarray ? @{$self->data} : $self->data->[0];
25 $self->type.': '.join ' ', @{$self->data};