| line |
l |
!l&&r |
!l&&!r |
condition |
|
99
|
0 |
0 |
0 |
$self->{'rtm'} //= $self->http_get("uri", $self->endpoint("rtm_connect"))->then(sub {
my $result = shift();
return "Future"->done("URI"->new($result->{'url'})) if exists $result->{'url'};
return "Future"->fail("invalid URL");
}
)->then(sub {
my($uri) = @_;
$self->add_child(my $rtm = "Net::Async::Slack::RTM"->new("slack", $self, "wss_uri", $uri));
$rtm->connect->transform("done", sub {
$rtm;
}
);
}
) |
|
154
|
0 |
0 |
0 |
$args{'text'} or $args{'attachments'} |
|
365
|
0 |
0 |
0 |
$self->{'endpoints'} ||= do {
my $path = Path::Tiny::path(&__DIR__())->parent(3)->child("share/endpoints.json");
$path = Path::Tiny::path(File::ShareDir::dist_file("Net-Async-Slack", "endpoints.json")) unless $path->exists;
$Net::Async::Slack::log->tracef("Loading endpoints from %s", $path);
decode_json_text($path->slurp_utf8)
} |
|
396
|
0 |
0 |
0 |
$self->{'oauth'} //= "Net::Async::OAuth::Client"->new("realm", "Slack", "consumer_key", $self->key, "consumer_secret", $self->secret, "token", $self->token, "token_secret", $self->token_secret) |
|
451
|
0 |
0 |
0 |
$self->{'http'} ||= do {
require Net::Async::HTTP;
$self->add_child(my $ua = "Net::Async::HTTP"->new("fail_on_error", 1, "close_after_request", 0, "max_connections_per_host", 4, "pipeline", 1, "max_in_flight", 8, "decode_content", 1, "timeout", 30, "user_agent", "Mozilla/4.0 (perl; https://metacpan.org/pod/Net::Async::Slack; TEAM\@cpan.org)"));
$ua
} |
|
481
|
0 |
0 |
0 |
$args{'headers'} ||= $self->auth_headers |
|
552
|
0 |
0 |
0 |
$args{'headers'} ||= $self->auth_headers |