diff Lib/IMPL/Web/Application/ResourceContract.pm @ 302:673581380e79

Added templates provider functionality to controls minor fixes
author cin
date Mon, 01 Apr 2013 00:41:48 +0400
parents 546957c50a36
children fe725fad2d90
line wrap: on
line diff
--- a/Lib/IMPL/Web/Application/ResourceContract.pm	Mon Mar 25 02:04:18 2013 +0400
+++ b/Lib/IMPL/Web/Application/ResourceContract.pm	Mon Apr 01 00:41:48 2013 +0400
@@ -1,5 +1,7 @@
 package IMPL::Web::Application::ResourceContract;
 use strict;
+
+use IMPL::lang;
 use IMPL::Const qw(:prop);
 use IMPL::declare {
 	require => {
@@ -40,7 +42,12 @@
 	my %nameMap;
 
 	foreach my $res (@$resources) {
+		if (ref $res->{contract} eq 'HASH') {
+		    $res->{contract} = __PACKAGE__->new(%{$res->{contract}});
+		}
+		
 		next unless $res->{contract};
+		
 		if ( my $name = $res->{name} ) {
 			$nameMap{$name} = $res;
 		}