Mercurial > pub > Impl
diff Lib/IMPL/Web/View/TTControl.pm @ 334:71221d79e6b4
removing web resources contracts
author | cin |
---|---|
date | Thu, 13 Jun 2013 02:24:57 +0400 |
parents | 109f28643025 |
children | 1090c1dd7429 |
line wrap: on
line diff
--- a/Lib/IMPL/Web/View/TTControl.pm Tue Jun 11 20:22:52 2013 +0400 +++ b/Lib/IMPL/Web/View/TTControl.pm Thu Jun 13 02:24:57 2013 +0400 @@ -2,7 +2,7 @@ use strict; use IMPL::Const qw(:prop); -use IMPL::lang qw(:hash); +use IMPL::lang qw(:hash :base); use Scalar::Util qw(blessed reftype); use IMPL::declare { require => { @@ -33,17 +33,24 @@ our $AUTOLOAD_REGEX = qr/^[a-z]/; +my %mapSkipAttributes = map { $_, 1 } qw(attributes context); + sub CTOR { my ($this,$template,$context,$attrs) = @_; $this->template( $template ) or die new IMPL::ArgumentException("A template is required"); - $this->context( $context ) or die new IMPL::ArgumentException("A context is required"); + + die IMPL::ArgumentException->new(context => "A context is required, supplied: $context") + unless is($context,TTContext); + + $this->context( $context ); $this->attributes({}); if(ref($attrs) eq 'HASH') { while (my($key,$value) = each %$attrs) { + next if $mapSkipAttributes{$key}; $this->SetAttribute($key,$value); } }