Aion

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

         "web" : "https://github.com/darviarush/perl-aion"
      }
   },
   "version" : "2.2",
   "x_authority" : "cpan:DART",
   "x_contributors" : [
      "Iaroslav O. Kosmina <darviarush@mail.ru>",
      "Iaroslav O. Kosmina <darviarush@ya.ru>",
      "Yaroslav O. Kosmina <dart@cpan.org>"
   ],
   "x_serialization_backend" : "JSON::PP version 4.16",
   "x_static_install" : 0
}

i18n/Aion/Types.ru-en.po  view on Meta::CPAN


msgid "И у него перегружены указанные операторы."
msgstr "And the specified operators are overloaded."

msgid "Класс или объект наследует классы из списка."
msgstr "A class or object inherits classes from a list."

msgid "Класс или объект имеет указанные роли."
msgstr "A class or object has the specified roles."

msgid "Проверяет 1, 0, \"\", undef или объект с перегруженным оператором `bool` или `0+` как `JSON::PP::Boolean`. Во втором случае вызывает оператор  `0+` и проверя...
msgstr "Tests for 1, 0, \"\", undef, or an object with an overloaded `bool` or `0+` operator as `JSON::PP::Boolean`. In the second case, it calls the `0+` operator and checks the result as `Bool`."

msgid "`BoolLike` вызывает оператор `0+` и проверяет результат."
msgstr "`BoolLike` calls the `0+` operator and checks the result."

msgid "Строка или объект с перегруженным оператором `\"\"`."
msgstr "A string or object overloaded with the `\"\"` operator."

msgid "Регулярное выражение или объект с перегруженным оператором `qr`."
msgstr "A regular expression or object with an overload of the `qr` operator."

lib/Aion/Types.md  view on Meta::CPAN


'RoleExample' ~~ ConsumerOf[qw/Role1/] # -> 1
'RoleExample' ~~ ConsumerOf[qw/Role2 Role1/] # -> 1
bless({}, 'RoleExample') ~~ ConsumerOf[qw/Role3 Role2 Role1/] # -> ""

'NoneExample' ~~ ConsumerOf[qw/Role1/] # -> ""
```

## BoolLike

Проверяет 1, 0, "", undef или объект с перегруженным оператором `bool` или `0+` как `JSON::PP::Boolean`. Во втором случае вызывает оператор  `0+` и проверяет ре...

`BoolLike` вызывает оператор `0+` и проверяет результат.

```perl
package BoolLikeExample {
	use overload '0+' => sub { ${$_[0]} };
}

bless(\(my $x = 1 ), 'BoolLikeExample') ~~ BoolLike # -> 1
bless(\(my $x = 11), 'BoolLikeExample') ~~ BoolLike # -> ""

lib/Aion/Types.pm  view on Meta::CPAN

	package RoleExample { sub DOES { $_[1] ~~ [qw/Role1 Role2/] } }
	
	'RoleExample' ~~ ConsumerOf[qw/Role1/] # -> 1
	'RoleExample' ~~ ConsumerOf[qw/Role2 Role1/] # -> 1
	bless({}, 'RoleExample') ~~ ConsumerOf[qw/Role3 Role2 Role1/] # -> ""
	
	'NoneExample' ~~ ConsumerOf[qw/Role1/] # -> ""

=head2 BoolLike

Tests for 1, 0, "", undef, or an object with an overloaded C<bool> or C<0+> operator as C<JSON::PP::Boolean>. In the second case, it calls the C<0+> operator and checks the result as C<Bool>.

C<BoolLike> calls the C<0+> operator and checks the result.

	package BoolLikeExample {
		use overload '0+' => sub { ${$_[0]} };
	}
	
	bless(\(my $x = 1 ), 'BoolLikeExample') ~~ BoolLike # -> 1
	bless(\(my $x = 11), 'BoolLikeExample') ~~ BoolLike # -> ""
	

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


local ($::_g0 = do {'RoleExample' ~~ ConsumerOf[qw/Role1/]}, $::_e0 = do {1}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '\'RoleExample\' ~~ ConsumerOf[qw/Role1/] # -> 1' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; unde...
local ($::_g0 = do {'RoleExample' ~~ ConsumerOf[qw/Role2 Role1/]}, $::_e0 = do {1}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '\'RoleExample\' ~~ ConsumerOf[qw/Role2 Role1/] # -> 1' or ::diag ::_struct_diff($::_g0, $::_e0); undef ...
local ($::_g0 = do {bless({}, 'RoleExample') ~~ ConsumerOf[qw/Role3 Role2 Role1/]}, $::_e0 = do {""}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, 'bless({}, \'RoleExample\') ~~ ConsumerOf[qw/Role3 Role2 Role1/] # -> ""' or ::diag ::...

local ($::_g0 = do {'NoneExample' ~~ ConsumerOf[qw/Role1/]}, $::_e0 = do {""}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, '\'NoneExample\' ~~ ConsumerOf[qw/Role1/] # -> ""' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; un...

# 
# ## BoolLike
# 
# Проверяет 1, 0, "", undef или объект с перегруженным оператором `bool` или `0+` как `JSON::PP::Boolean`. Во втором случае вызывает оператор  `0+` и проверяет р...
# 
# `BoolLike` вызывает оператор `0+` и проверяет результат.
# 
::done_testing; }; subtest 'BoolLike' => sub { 
package BoolLikeExample {
	use overload '0+' => sub { ${$_[0]} };
}

local ($::_g0 = do {bless(\(my $x = 1 ), 'BoolLikeExample') ~~ BoolLike}, $::_e0 = do {1}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, 'bless(\(my $x = 1 ), \'BoolLikeExample\') ~~ BoolLike # -> 1' or ::diag ::_struct_diff($::_g0, $...
local ($::_g0 = do {bless(\(my $x = 11), 'BoolLikeExample') ~~ BoolLike}, $::_e0 = do {""}); ::ok defined($::_g0) == defined($::_e0) && $::_g0 eq $::_e0, 'bless(\(my $x = 11), \'BoolLikeExample\') ~~ BoolLike # -> ""' or ::diag ::_struct_diff($::_g0,...



( run in 0.516 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )