Skip to content

Use structure in TO_JSON method when available #38

@dannymk

Description

@dannymk

Perhaphs add a sub that takes an instance that can actually return a structure that only includes items that we want in the output:

multi sub to-json ( $_ where *.can('TO_JSON') ) {
    to-json .TO_JSON
}

see: https://stackoverflow.com/questions/53110521/perl6-class-to-json-exclude-properties/53120677#53120677

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions