Data::HAL::Link - Hypertext Application Language link
This document describes Data::HAL::Link version 1.000
map { +{ href => $_->href->uri->as_string, rel => $_->relation->uri->as_string } } @{ $resource->links }
This section is completely quoted from the specification:
A Link Object represents a hyperlink from the containing resource to a URI.
None.
new
When the "deprecation" attribute is set, the constructor logs a Log::Any warning:
The link (relation: "%s", href: "%s") is deprecated, see <%s>
You can consume it with a Log::Any::Adapter of your choice, e.g.
use Log::Any::Adapter 'Stderr';
Otherwise the constructor behaves like the default Moo constructor. Returns a Data::HAL::Link object.
Data::HAL::Link
Perl strings are coerced to the Data::HAL::URI type in the attributes "relation", "href", "deprecation", "profile".
relation
Type Data::HAL::URI, required, link relation
href
Type Data::HAL::URI, required, link target URI or URI template
templated
Type boolean, whether href is a URI template
Perl boolean values are coerced to the boolean type.
type
Type MIME::Type, media type of the href resource
deprecation
Type Data::HAL::URI, if existing indicates the link is deprecated
Setting the attribute triggers a log message in the constructor "new".
name
Type Str, secondary key for selecting link objects which share the same relation type
Str
profile
Type Data::HAL::URI, RFC 6906 profile of the target resource
title
Type Str, labels the link with a human-readable identifier
hreflang
Type Str, indicates the language of the target resource
as_http_link_value
Returns the link as a RFC 5988 link-value string, e.g. </orders?page=2>;rel="next".
link-value
</orders?page=2>;rel="next"
See "new" constructor.
Requires no configuration files or environment variables.
To install Data::HAL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::HAL
CPAN shell
perl -MCPAN -e shell install Data::HAL
For more information on module installation, please visit the detailed CPAN module installation guide.