Skip to content

Use structure in TO_JSON method when available #38

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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