do not include .git directory
[catagits/Reaction.git] / lib / Reaction / UI / ViewPort / Field / RelatedObject.pm
1 package Reaction::UI::ViewPort::Field::RelatedObject;
2
3 use Reaction::Class;
4 use Scalar::Util 'blessed';
5 use MooseX::Types::Moose qw/Str/;
6
7 use namespace::clean -except => [ qw(meta) ];
8 extends 'Reaction::UI::ViewPort::Field';
9
10 has value_map_method => (
11   isa => Str, is => 'ro', required => 1, default => sub { 'display_name' },
12 );
13
14 around _value_string_from_value => sub {
15   my $orig = shift;
16   my $self = shift;
17   my $meth = $self->value_map_method;
18   return $self->$orig(@_)->$meth;
19 };
20
21 __PACKAGE__->meta->make_immutable;
22
23
24 1;