NAME
Mojolicious::Plugin::LinkEmbedder::Link - Base class for links
ATTRIBUTES
error
my $err = $link->error;
$link = $link->error({message => "Some error"});
Get or set error. Default to undef
on no error.
etag
author_name
Name of the person who created the content.
author_url
URL to "author_name".
media_id
Returns the part of the URL identifying the media. Default is empty string.
provider_name
Example: "Twitter".
provider_url
Example https://twitter.com.
title
Some title
ua
Holds a Mojo::UserAgent object.
url
Holds a Mojo::URL object.
METHODS
is
$bool = $self->is($str);
$bool = $self->is('video');
$bool = $self->is('video-youtube');
Convertes $str
using "camelize" in Mojo::Util and checks if $self
is of that type:
$self->isa('Mojolicious::Plugin::LinkEmbedder::Link::' .Mojo::Util::camelize($_[1]));
learn
$self->learn($c, $cb);
This method can be used to learn more information about the link. This class has no idea what to learn, so it simply calls the callback ($cb
) with @cb_args
.
pretty_url
Returns a pretty version of the "url". The default is to return a cloned version of "url".
tag
$bytestream = $self->tag(a => href => "http://google.com", sub { "link });
Same as https://metacpan.org/pod/Mojolicious::Plugin::TagHelpers#tag.
to_embed
Returns a link to the "url", with target "_blank".
AUTHOR
Jan Henning Thorsen - jan.henning@thorsen.pm