Group
Extension

Matches 2

MooX-Role-JSON_LD ( D/DA/DAVECROSS/MooX-Role-JSON_LD-2.0.0.tar.gz, DAVECROSS, 2025; MetaCPAN )
MooX-Role-JSON_LD/lib/MooX/JSON_LD.pm ( view source; MetaCPAN )
NAME

MooX::JSON_LD - Extend Moo to provide JSON-LD mark-up for your objects.

=head1 SYNOPSIS

    # Your Moo (or Moose) Class
    package My::Moo::Class;

    use Moo;

    use MooX::JSON_LD 'Person
',
      # various other properties...
      json_ld => 1,
    );

    has last_name  => (
      is => 'ro',
      # various other properties...
      json_ld => 1,
    );

    has birth_date => (
   
   is => 'ro',
      # various other properties...
      json_ld => 'birthDate',
      json_ld_serializer => sub { shift->birth_date },
    );

    # Then, in a program somewhere...
    use My::Moo::C
MooX-Role-JSON_LD ( D/DA/DAVECROSS/MooX-Role-JSON_LD-2.0.0.tar.gz, DAVECROSS, 2025; MetaCPAN )
MooX-Role-JSON_LD/lib/MooX/Role/JSON_LD.pm ( view source; MetaCPAN )
MooX::Role::JSON_LD - Easily provide JSON-LD mark-up for your objects.

=head1 SYNOPSIS

    # Your Moo (or Moose) Class
    package My::Moo::Class;

    use Moo;
    with 'MooX::Role::JSON_LD';

    
      # Various other properties
    );

    # Add two required methods
    sub json_ld_type { 'Person' };

    sub json_ld_fields { [ qw[ first_name last_name birth_date ] ] };

    # Then, in a prog
int a text representation of the JSON-LD
    print $obj->json_ld;

    # print the raw data structure for the JSON-LD
    use Data::Dumper;
    print Dumper $obj->json_ld_data;

=head1 DESCRIPTION

Th

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