('CODE' eq (Scalar::Util::reftype($code) || ''))
|| confess "You must supply a CODE reference to bless, not (" . ($code || 'undef') . ")";
+ ($options{package_name} && $options{name})
+ || confess "You must supply the package_name and name parameters";
+
# return the new object
$class->meta->new_object(body => $code, %options);
});
Class::MOP::Method::Generated->meta->add_method('new' => sub {
my ($class, %options) = @_;
+ ($options{package_name} && $options{name})
+ || confess "You must supply the package_name and name parameters";
my $self = $class->meta->new_object(%options);
$self->initialize_body;
$self;
(Scalar::Util::blessed($options{attribute}) && $options{attribute}->isa('Class::MOP::Attribute'))
|| confess "You must supply an attribute which is a 'Class::MOP::Attribute' instance";
+ ($options{package_name} && $options{name})
+ || confess "You must supply the package_name and name parameters";
+
# return the new object
my $self = $class->meta->new_object(%options);
|| confess "You must pass a metaclass instance if you want to inline"
if $options{is_inline};
+ ($options{package_name} && $options{name})
+ || confess "You must supply the package_name and name parameters";
+
# return the new object
my $self = $class->meta->new_object(%options);