NAME

Net::RDAP::JCard::Node - an object representing a node in a Net::RDAP::JCard object.

SYNOPSIS

#
# get a node by calling the nodes() method on a Net::RDAP::JCard object
#
$node = ($vcardArray->nodes('tel'))[0];

say $node->param('type');
say $node->value;

DESCRIPTION

The data in a jCard (RFC 7095) object is stored in a set of nodes, which this module represents.

Nodes have exactly four elements, specifically:

1. the node type, such as fn (full name) or email (email address);
2. parameters, which are represented as a hashref;
3. a value type, such as text or URI;
4. the node value, which can be a string or arrayref.

Net::RDAP::JCard::Node provides an ergonomic way to access these elements.

CONSTRUCTOR

$node = Net::RDAP::JCard::Node->new($ref);

You probably don't need to instantiate these objects yourself, but if you do, you just need to pass an arrayref.

METHODS

$type = $node->type;

Returns a string containing the node type.

$params = $node->params;

Returns a hashref containing the node parameters.

$param = $node->param($name);

Returns the value of the $name parameter or undef.

$value_type = $node->value_type;

Returns a string containing the node value's type. See the vCard Value Data Types IANA registry for a list of possible values.

$value = $node->value;

Returns the node value.

COPYRIGHT

Copyright 2024 Gavin Brown. All rights reserved.

LICENSE

Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the author not be used in advertising or publicity pertaining to distribution of the software without specific prior written permission.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.