# HG changeset patch # User sergey # Date 1347021137 -14400 # Node ID 70ad6bc20908196a6956e61a473e7b64a9e2e313 # Parent b6cde007a175fadbe59c856569f6782b0ae731f4 sync diff -r b6cde007a175 -r 70ad6bc20908 Lib/IMPL/Web/Application/ResourceContract.pm --- a/Lib/IMPL/Web/Application/ResourceContract.pm Wed Sep 05 15:10:26 2012 +0400 +++ b/Lib/IMPL/Web/Application/ResourceContract.pm Fri Sep 07 16:32:17 2012 +0400 @@ -2,17 +2,32 @@ use strict; use IMPL::lang qw(:declare); use IMPL::declare { + require => { + 'ResourceClass' => 'IMPL::Web::Application::Resource' + }, base => [ 'IMPL::Object' => undef ] }; BEGIN { + public property resourceFactory => PROP_ALL; public property operations => PROP_ALL; private property _namedResources => PROP_ALL; private property _regexpResources => PROP_ALL; } +sub CTOR { + my $this = shift; + my %args = @_; + + $this->resourceFactory( $args{resourceFactory} || ResourceClass ); +} + +sub CreateResource { + my ($this,) +} + 1; __END__ @@ -58,6 +73,14 @@ ] ) +my $obj = My::App::Data->fetch('something'); + +my $resource = $contract->CreateResource( + model => $obj, + parent => $prentResource, + id => 'item-something' +); + =end code =head1 DESCRIPTION