vity => '/activities/ID'
);
# transform our api dispatch above into an HTTPS request
# returns JSON decoded result or throws exception otherwise
sub _request {
my ($self, $api, $id, $args) = @_;
uccess and return $tx->res->json;
# we never get here, unless something went wrong
my $message = $tx->error;
$tx->res->json and do {
my $json_err = $tx->res->json->{error}->{message};
$
message = join ' ', $message => $json_err;
};
die "Error: $message";
}
sub new {
my $self = bless {}, shift;
croak "API key required" unless $_[0] and $_[0] eq 'key';
$self->key($_[1]);