Class-XSConstructor

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

            "Exporter::Tiny" : "1.000000",
            "List::Util" : "1.45",
            "perl" : "5.008008"
         }
      },
      "test" : {
         "recommends" : {
            "Types::Standard" : "1.000000"
         },
         "requires" : {
            "Test::Fatal" : "0",
            "Test::More" : "0.96",
            "Test::Requires" : "0",
            "parent" : "0"
         }
      }
   },
   "provides" : {
      "Class::XSConstructor" : {
         "file" : "lib/Class/XSConstructor.pm",
         "version" : "0.023006"

META.yml  view on Meta::CPAN

---
abstract: 'a super-fast constructor in XS'
author:
  - 'Toby Inkster (TOBYINK) <tobyink@cpan.org>'
build_requires:
  Test::Fatal: '0'
  Test::More: '0.96'
  Test::Requires: '0'
  parent: '0'
configure_requires:
  ExtUtils::MakeMaker: '6.17'
dynamic_config: 1
generated_by: 'Dist::Inkt::Profile::TOBYINK version 0.024, CPAN::Meta::Converter version 2.150010'
keywords: []
license: perl
meta-spec:

Makefile.PL  view on Meta::CPAN

                                       requires   => {
                                                       "Exporter::Tiny" => "1.000000",
                                                       "List::Util" => 1.45,
                                                       "perl" => 5.008008,
                                                     },
                                     },
                        test      => {
                                       recommends => { "Types::Standard" => "1.000000" },
                                       requires   => {
                                                       "parent"         => 0,
                                                       "Test::Fatal"    => 0,
                                                       "Test::More"     => 0.96,
                                                       "Test::Requires" => 0,
                                                     },
                                     },
                      },
  "provides"       => {
                        "Class::XSConstructor" => { file => "lib/Class/XSConstructor.pm", version => 0.023006 },
                        "Class::XSDelegation"  => { file => "lib/Class/XSDelegation.pm", version => 0.023006 },
                        "Class::XSDestructor"  => { file => "lib/Class/XSDestructor.pm", version => 0.023006 },
                        "Class::XSReader"      => { file => "lib/Class/XSReader.pm", version => 0.023006 },

doap.ttl  view on Meta::CPAN

	doap-deps:develop-recommendation [ doap-deps:on "Dist::Inkt 0.001"^^doap-deps:CpanId ];
	doap-deps:runtime-recommendation [
		doap-deps:on "Types::Standard 1.000000"^^doap-deps:CpanId;
	], [ doap-deps:on "Type::Tiny::XS"^^doap-deps:CpanId ];
	doap-deps:runtime-requirement [ doap-deps:on "perl 5.008008"^^doap-deps:CpanId ], [
		doap-deps:on "Exporter::Tiny 1.000000"^^doap-deps:CpanId;
	], [ doap-deps:on "List::Util 1.45"^^doap-deps:CpanId ];
	doap-deps:test-recommendation [
		doap-deps:on "Types::Standard 1.000000"^^doap-deps:CpanId;
	];
	doap-deps:test-requirement [ doap-deps:on "Test::More 0.96"^^doap-deps:CpanId ], [ doap-deps:on "Test::Fatal"^^doap-deps:CpanId ], [ doap-deps:on "Test::Requires"^^doap-deps:CpanId ], [ doap-deps:on "parent"^^doap-deps:CpanId ];
	doap:bug-database    <https://github.com/tobyink/p5-class-xsconstructor/issues>;
	doap:created         "2018-06-19"^^xsd:date;
	doap:developer       <http://purl.org/NET/cpan-uri/person/tobyink>;
	doap:download-page   <https://metacpan.org/release/Class-XSConstructor>;
	doap:homepage        <https://metacpan.org/release/Class-XSConstructor>;
	doap:license         <http://dev.perl.org/licenses/>;
	doap:maintainer      <http://purl.org/NET/cpan-uri/person/tobyink>;
	doap:name            "Class-XSConstructor";
	doap:programming-language "Perl";
	doap:release         <http://purl.org/NET/cpan-uri/dist/Class-XSConstructor/v_0-001>, <http://purl.org/NET/cpan-uri/dist/Class-XSConstructor/v_0-002>, <http://purl.org/NET/cpan-uri/dist/Class-XSConstructor/v_0-003>, <http://purl.org/NET/cpan-uri/dis...

t/01basic.t  view on Meta::CPAN

This software is copyright (c) 2018-2019 by Toby Inkster.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut

use strict;
use warnings;
use Test::More;
use Test::Fatal;

{
	package Person;
	use Class::XSConstructor qw( name! age email phone );
}

{
	package Employee;
	use parent -norequire, qw(Person);
	use Class::XSConstructor qw( employee_id! );

t/02types.t  view on Meta::CPAN

This software is copyright (c) 2018-2019 by Toby Inkster.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut

use strict;
use warnings;
use Test::More;
use Test::Fatal;

BEGIN {
	package Local::Types;
	our $Int = sub {
		my $val = shift;
		!ref($val) and $val =~ /\A-?[0-9]+\z/;
	};
}

ok( $Local::Types::Int->('40'),   "Int('40')" );

t/03typenano.t  view on Meta::CPAN

This software is copyright (c) 2019 by Toby Inkster.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut

use strict;
use warnings;
use Test::More;
use Test::Fatal;
use Test::Requires { 'Type::Nano' => '0.013' };

{
	package Person;
	use Type::Nano qw(Int);
	use Class::XSConstructor qw( name! ), age => Int, qw( email phone );
}

{
	package Employee;

t/03typetiny.t  view on Meta::CPAN

This software is copyright (c) 2018-2019 by Toby Inkster.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut

use strict;
use warnings;
use Test::More;
use Test::Fatal;
use Test::Requires { 'Types::Standard' => '1.000000' };

{
	package Person;
	use Types::Standard qw(Int);
	use Class::XSConstructor qw( name! ), age => Int, qw( email phone );
}

{
	package Employee;

t/05strictconstructor.t  view on Meta::CPAN

This software is copyright (c) 2025 by Toby Inkster.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut

use strict;
use warnings;
use Test::More;
use Test::Fatal;

{
	package Person;
	use Class::XSConstructor qw( name! age email phone !! );
}

{
	package Employee;
	use parent -norequire, qw(Person);
	use Class::XSConstructor qw( employee_id! !! );

t/14undeftolerant.t  view on Meta::CPAN

This software is copyright (c) 2026 by Toby Inkster.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut

use strict;
use warnings;
use Test::More;
use Test::Fatal;

BEGIN {
	package Local::Types;
	our $Int = sub {
		my $val = shift;
		defined($val) and !ref($val) and $val =~ /\A-?[0-9]+\z/;
	};
}

ok( $Local::Types::Int->('40'),   "Int('40')" );

t/90clearer.t  view on Meta::CPAN

use strict;
use warnings;
use Test::More;
use Test::Fatal;

{
	package Local::Foo;
	use Class::XSConstructor qw( foo !! );
}

my $o = Local::Foo->new( foo => 42 );
is($o->{foo}, 42);

like(

t/bug-moosex.t  view on Meta::CPAN

use strict;
use warnings;
use Test::More;
use Test::Fatal;

BEGIN {
	eval {
		require Moose;
		require MooseX::XSAccessor;
		require MooseX::XSConstructor;
		require Types::Common;
		1;
	} or plan skip_all => 'Missing modules';
};



( run in 0.980 second using v1.01-cache-2.11-cpan-54e63673c56 )