davorg-cpan / moox-role-json_ld

Moo role to easily add JSON-LD generation into a class
1 stars 5 forks source link

Add MooX::JSON_LD #1

Closed robrwo closed 6 years ago

robrwo commented 6 years ago

This adds a helper module to use instead of the role:

    package::My::Moo::Class

    use Moo;

    use MooX::JSON_LD 'Person';

    has first_name => ( ... json_ld => 1 );
    has last_name  => ( ... json_ld => 1 );

    has birth date => ( ...
        json_ld => 'birthDate',
        json_ld_serializer => sub { shift->birth_date->ymd },
    );

It creates the needed methods and consumes the role.

robrwo commented 6 years ago

This is actually based on code I wrote in 2014 for an abandoned project.

coveralls commented 6 years ago

Pull Request Test Coverage Report for Build 26


Totals Coverage Status
Change from base Build 20: 5.09%
Covered Lines: 48
Relevant Lines: 50

💛 - Coveralls
coveralls commented 6 years ago

Pull Request Test Coverage Report for Build 22


Totals Coverage Status
Change from base Build 20: 5.09%
Covered Lines: 48
Relevant Lines: 50

💛 - Coveralls
robrwo commented 6 years ago

On 28/05/18 07:54, Dave Cross wrote:

Merged #1 https://github.com/davorg/moox-role-json_ld/pull/1.

My bad, but I think the t/lib/MooTester2.pm module is also missing from the MANIFEST.

I'd make another PR but you haven't pushed 0.0.9 to git yet.

davorg commented 6 years ago

I think this is all fixed now. 0.0.10 en route to CPAN.