++ed by:
BEROV

1 PAUSE user

Jan Henning Thorsen

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

media_id

Returns the part of the URL identifying the media. Default is empty string.

provider_name

  $str = $self->provider_name;

Example: "Twitter".

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