Group
Extension

Matches 12

JSON-TypeInference ( A/AE/AEREAL/JSON-TypeInference-1.0.2.tar.gz, AEREAL, 2015; MetaCPAN )
JSON-TypeInference/lib/JSON/TypeInference.pm ( view source; MetaCPAN )
package JSON::TypeInference;
use 5.008001;
use strict;
use warnings;

our $VERSION = "1.0.2";

use List::Util qw(first);
use List::UtilsBy qw(partition_by sort_by);

use JSON::TypeInference::Type::Arr
e JSON::TypeInference::Type::Boolean;
use JSON::TypeInference::Type::Maybe;
use JSON::TypeInference::Type::Null;
use JSON::TypeInference::Type::Number;
use JSON::TypeInference::Type::Object;
use JSON:
ypeInference::Type::String;
use JSON::TypeInference::Type::Union;
use JSON::TypeInference::Type::Unknown;

use constant ENTITY_TYPE_CLASSES => [
  map { join '::', 'JSON::TypeInference::Type', $_ } qw
JSON-TypeInference ( A/AE/AEREAL/JSON-TypeInference-1.0.2.tar.gz, AEREAL, 2015; MetaCPAN )
JSON-TypeInference/lib/JSON/TypeInference/Type/String.pm ( view source; MetaCPAN )
package JSON::TypeInference::Type::String;
use strict;
use warnings;
use parent qw(JSON::TypeInference::Type::Atom);

use Scalar::Util qw(looks_like_number);

sub name {
  my ($class) = @_;
  return '
ND__

=encoding utf-8

=head1 NAME

JSON::TypeInference::Type::String - JSON string type

=head1 DESCRIPTION

C< JSON::TypeInference::Type::String > represents JSON string type.

It is a value type, a
JSON-TypeInference ( A/AE/AEREAL/JSON-TypeInference-1.0.2.tar.gz, AEREAL, 2015; MetaCPAN )
JSON-TypeInference/lib/JSON/TypeInference/Type/Null.pm ( view source; MetaCPAN )
package JSON::TypeInference::Type::Null;
use strict;
use warnings;
use parent qw(JSON::TypeInference::Type::Atom);

sub name {
  my ($class) = @_;
  return 'null';
}

sub accepts {
  my ($class, $data
__END__

=encoding utf-8

=head1 NAME

JSON::TypeInference::Type::Null - JSON null type

=head1 DESCRIPTION

C< JSON::TypeInference::Type::Null > represents JSON null type.

It is a value type, and so
JSON-TypeInference ( A/AE/AEREAL/JSON-TypeInference-1.0.2.tar.gz, AEREAL, 2015; MetaCPAN )
JSON-TypeInference/lib/JSON/TypeInference/Type/Array.pm ( view source; MetaCPAN )
package JSON::TypeInference::Type::Array;
use strict;
use warnings;

sub new {
  my ($class, $element_type) = @_;
  return bless { element_type => $element_type }, $class;
}

sub name {
  my ($class) 

__END__

=encoding utf-8

=head1 NAME

JSON::TypeInference::Type::Array - JSON array type

=head1 DESCRIPTION

JSON::TypeInference::Type::Array represents JSON array type.

It is a container type, an
JSON-TypeInference ( A/AE/AEREAL/JSON-TypeInference-1.0.2.tar.gz, AEREAL, 2015; MetaCPAN )
JSON-TypeInference/lib/JSON/TypeInference/Type/Union.pm ( view source; MetaCPAN )
package JSON::TypeInference::Type::Union;
use strict;
use warnings;

sub new {
  my ($class, @types) = @_;
  return bless { _types => \@types }, $class;
}

sub name {
  my ($class) = @_;
  return 'uni
ding utf-8

=head1 NAME

JSON::TypeInference::Type::Union - union type

=head1 DESCRIPTION

C< JSON::TypeInference::Type::Union > consists of one or more value types.

C< JSON::TypeInference::Type::Un
JSON-TypeInference ( A/AE/AEREAL/JSON-TypeInference-1.0.2.tar.gz, AEREAL, 2015; MetaCPAN )
JSON-TypeInference/lib/JSON/TypeInference/Type/Unknown.pm ( view source; MetaCPAN )
package JSON::TypeInference::Type::Unknown;
use strict;
use warnings;
use parent qw(JSON::TypeInference::Type::Atom);

sub name {
  my ($class) = @_;
  return 'unknown';
}

sub accepts {
  my ($class,
JSON::TypeInference::Type::Unknown - unknown type

=head1 DESCRIPTION

C< JSON::TypeInference::Type::Unknown > is retuned if C<< JSON::TypeInference >> encountered a value that does not match any JSON
JSON-TypeInference ( A/AE/AEREAL/JSON-TypeInference-1.0.2.tar.gz, AEREAL, 2015; MetaCPAN )
JSON-TypeInference/lib/JSON/TypeInference/Type/Atom.pm ( view source; MetaCPAN )
package JSON::TypeInference::Type::Atom;
use strict;
use warnings;

sub new {
  my ($class) = @_;
  return bless {}, $class;
}

sub signature {
  my ($self) = @_;
  return ref($self)->name;
}

1;
__EN
oding utf-8

=head1 NAME

JSON::TypeInference::Type::Atom - Base class for JSON value types

=head1 DESCRIPTION

C< JSON::TypeInference::Type::Atom > is a base class for JSON value type and provides s
JSON-TypeInference ( A/AE/AEREAL/JSON-TypeInference-1.0.2.tar.gz, AEREAL, 2015; MetaCPAN )
JSON-TypeInference/lib/JSON/TypeInference/Type/Boolean.pm ( view source; MetaCPAN )
package JSON::TypeInference::Type::Boolean;
use strict;
use warnings;
use parent qw(JSON::TypeInference::Type::Atom);

use Types::Serialiser;

sub name {
  my ($class) = @_;
  return 'boolean';
}

sub
D__

=encoding utf-8

=head1 NAME

JSON::TypeInference::Type::Boolean - JSON boolean type

=head1 DESCRIPTION

C< JSON::TypeInference::Type::Boolean > represents JSON boolean type.

It is a value type
JSON-TypeInference ( A/AE/AEREAL/JSON-TypeInference-1.0.2.tar.gz, AEREAL, 2015; MetaCPAN )
JSON-TypeInference/lib/JSON/TypeInference/Type/Maybe.pm ( view source; MetaCPAN )
package JSON::TypeInference::Type::Maybe;
use strict;
use warnings;

use List::Util qw(any);

# ArrayRef[JSON::TypeInference::Type] => Bool
sub looks_like_maybe {
  my ($class, $candidate_types) = @_;

  return (scalar(@$candidate_types) == 2) && any { $_->isa('JSON::TypeInference::Type::Null') } @$candidate_types;
}

sub new {
  my ($class, $type) = @_;
  return bless { type => $type }, $class;
}
= @_;
  return 0;
}

1;
__END__

=encoding utf-8

=head1 NAME

JSON::TypeInference::Type::Maybe - maybe type

=head1 DESCRIPTION

C< JSON::TypeInference::Type::Maybe > represents a possibility whether
JSON-TypeInference ( A/AE/AEREAL/JSON-TypeInference-1.0.2.tar.gz, AEREAL, 2015; MetaCPAN )
JSON-TypeInference/lib/JSON/TypeInference/Type/Object.pm ( view source; MetaCPAN )
package JSON::TypeInference::Type::Object;
use strict;
use warnings;

sub new {
  my ($class, $properties) = @_;
  return bless { properties => $properties }, $class;
}

sub name {
  my ($class) = @_;
ND__

=encoding utf-8

=head1 NAME

JSON::TypeInference::Type::Object - JSON object type

=head1 DESCRIPTION

C< JSON::TypeInference::Type::Object > represents JSON object type.

It is a container typ
JSON-TypeInference ( A/AE/AEREAL/JSON-TypeInference-1.0.2.tar.gz, AEREAL, 2015; MetaCPAN )
JSON-TypeInference/lib/JSON/TypeInference/Type/Number.pm ( view source; MetaCPAN )
package JSON::TypeInference::Type::Number;
use strict;
use warnings;
use parent qw(JSON::TypeInference::Type::Atom);

use Scalar::Util qw(looks_like_number);

sub name {
  my ($class) = @_;
  return '
ND__

=encoding utf-8

=head1 NAME

JSON::TypeInference::Type::Number - JSON number type

=head1 DESCRIPTION

C< JSON::TypeInference::Type::Number > represents JSON number type.

It is a value type, a
JSON-TypeInference ( A/AE/AEREAL/JSON-TypeInference-1.0.2.tar.gz, AEREAL, 2015; MetaCPAN )
JSON-TypeInference/lib/JSON/TypeInference/Type.pod ( view source; MetaCPAN )
encoding utf-8

=head1 NAME

JSON::TypeInference::Type - Classes of JSON types

=head1 DESCRIPTION

The implementations of JSON::TypeInference::Type represent types of JSON values.

They must implemen

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.