$object->{what}->frobozz; # called on $ref1 if still alive
# TO_JSON always returns undef
my $will_be_undef = $object->TO_JSON;
=head1 DESCRIPTION
This module provides a little wrapper class
on't have
to worry about circular references.
Additionally, when some JSON encoder tries to encode this object calling
L</TO_JSON>, it will get C<undef> back. This comes handy if you want to
e.g. def
rns C<$object> for possible chaining.
=head2 B<< TO_JSON >>
my $this_is_undef = $object->TO_JSON;
Return C<undef>. This will be called by JSON encoders when configured to
do so for blessed objec
huh?
}
sub parse_request {
my ($self, $request) = @_;
my @updates = $request->json;
return @updates;
}
sub render_response {
my ($self, $controller, $response, $
= $response->{chat_id}
// $update->{message}{chat}{id};
return $controller->render(json => $response);
}
1;
=head1 DESCRIPTION
This is an updates receiver and dispatcher role f
ssage::Request> and return all the updates
inside.
Defaults to just returning C<< $req->json >>, i.e. the JSON decoding of
the request's content, which should work in most cases. You should
override
huh?
}
sub parse_request {
my ($self, $request) = @_;
my @updates = $request->json;
return @updates;
}
sub render_response {
my ($self, $controller, $response, $
= $response->{chat_id}
// $update->{message}{chat}{id};
return $controller->render(json => $response);
}
1;
=head1 DESCRIPTION
This role abstracts elements that identify a sour
>handler($args);
return $r->$method($p => $h);
} ## end sub install_route
sub parse_request { # most APIs rely on JSON... let's leverage this
my ($self, $req) = @_;
return $req->json;
}
1;
GET => 'http://frobozz.example.com/v1/whatever',
{Accept => 'application/json'},
json => $message
);
}
1;
=head1 DESCRIPTION
This role adds some user-agent capa
GET => 'http://frobozz.example.com/v1/whatever',
{Accept => 'application/json'},
json => $message
);
}
1;
=head1 DESCRIPTION
This is a sender role for bots.
=h
args) {
my ($key, $value) = splice @args, 0, 2;
$self->{$key} = $value;
weaken($self->{$key}) if ref $value;
}
return $self;
} ## end sub set
sub TO_JSON { return undef }
1;