Mercurial > pub > Impl
comparison Lib/IMPL/Web/RestContract.pm @ 200:a9dbe534d236
sync
author | sergey |
---|---|
date | Tue, 24 Apr 2012 02:34:49 +0400 |
parents | e743a8481327 |
children | 292226770180 |
comparison
equal
deleted
inserted
replaced
199:e743a8481327 | 200:a9dbe534d236 |
---|---|
28 | 28 |
29 $props ||= {}; | 29 $props ||= {}; |
30 | 30 |
31 if (ref $t eq 'HASH') { | 31 if (ref $t eq 'HASH') { |
32 my $factory = $t->{factory} || TRestResource; | 32 my $factory = $t->{factory} || TRestResource; |
33 return $factory->new(%$t, target => $obj, %$props); | 33 return $factory->new(%$t, target => $obj, contract => $this, %$props); |
34 } elsif (ref $t eq 'CODE') { | 34 } elsif (ref $t eq 'CODE') { |
35 return $this->$t($obj,$props); | 35 return $this->$t($obj,$props); |
36 } else { | 36 } else { |
37 die InvalidOpException->new(); | 37 die InvalidOpException->new(); |
38 } | 38 } |