1 package ComponentUI::TestModel::Foo::SearchSpec;
3 use namespace::autoclean;
5 use MooseX::Types::Common::String qw/NonEmptySimpleStr/;
7 with 'Reaction::InterfaceModel::Search::Spec';
9 has 'first_name' => (isa => NonEmptySimpleStr, is => 'rw', required => 0);
10 has 'last_name' => (isa => NonEmptySimpleStr, is => 'rw', required => 0);
12 sub _build__search_spec {
15 $search{first_name} = $self->first_name if $self->has_first_name;
16 $search{last_name} = $self->last_name if $self->has_last_name;
20 # no special packing/unpacking required for Foo
21 sub _to_string_pack_value { $_[1] }
22 sub _from_string_unpack_value { $_[1] }