Group
Extension

Matches 1

MooX-TO_JSON ( J/JJ/JJNAPIORK/MooX-TO_JSON-0.001.tar.gz, JJNAPIORK, 2019; MetaCPAN )
MooX-TO_JSON/lib/MooX/TO_JSON.pm ( view source; MetaCPAN )
package MooX::TO_JSON;

use warnings;
use strict;

our $VERSION = '0.001';
$VERSION = eval $VERSION;

use Class::Method::Modifiers qw(install_modifier);

sub import {
  my ($class) = @_;
  my $target 
= caller;

  my @to_json;
  install_modifier $target, 'fresh', 'TO_JSON', sub {
    my $self = shift;
    my @structure = ();
    foreach my $rule (@to_json) {

      if($rule->{omit_if_empty}) {
    
$rule->{mapped_field} => $value,
      );
    }
    @structure = $self->modify_json(@structure) if $self->can('modify_json');
    return +{ @structure };
  };

  my %types = (
    str => 1,
    num =>

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