Mail::AuthenticationResults::Header::Base(3pm)

NAME
Mail::AuthenticationResults::Header::Base - Base class for modelling parts of the Authentication Results Header

VERSION
version 2.20260216

DESCRIPTION
Set of classes representing the various parts and sub parts of Authentication Results Headers.

•   Mail::AuthenticationResults::Header represents a complete Authentication Results Header set

•   Mail::AuthenticationResults::Header::AuthServID represents the AuthServID part of the set

•   Mail::AuthenticationResults::Header::Comment represents a comment

•   Mail::AuthenticationResults::Header::Entry represents a main entry

•   Mail::AuthenticationResults::Header::Group represents a group of parts, typically as a search result

•   Mail::AuthenticationResults::Header::SubEntry represents a sub entry part

•   Mail::AuthenticationResults::Header::Version represents a version part

    Header
        AuthServID
            Version
            Comment
            SubEntry
        Entry
            Comment
        Entry
            Comment
            SubEntry
                Comment
        Entry
            SubEntry
            SubEntry

    Group
        Entry
            Comment
        SubEntry
            Comment
        Entry
            SubEntry

METHODS

  new()
Return a new instance of this class

  set_key( $key )
Set the key for this instance.

Croaks if $key is invalid.

  key()
Return the current key for this instance.

Croaks if this instance type can not have a key.

  safe_set_value( $value )
Set the value for this instance.

Munges the value to remove invalid characters before setting.

This method also removes some value characters when their inclusion would be likely to break simple parsers.

  set_value( $value )
Set the value for this instance.

Croaks if the value contains invalid characters.

  value()
Returns the current value for this instance.

  stringify( $value )
Returns $value with stringify rules applied.

  children()
Returns a listref of this instances children.

Croaks if this instance type can not have children.

  orphan()
Removes the parent for this instance.

Croaks if this instance does not have a parent.

  copy_children_from( $object )
Copy (clone) all of the children from the given object into this object.

  add_parent( $parent )
Sets the parent for this instance to the supplied object.

Croaks if the relationship between $parent and $self is not valid.

  parent()
Returns the parent object for this instance.

  remove_child( $child )
Removes $child as a child of this instance.

Croaks if the relationship between $child and $self is not valid.

  add_child( $child )
Adds $child as a child of this instance.

Croaks if the relationship between $child and $self is not valid.

  add_entry ($key, $value)
Creates a new entry with the given key and value, and then adds that as a child.

Returns the child added.

  add_sub_entry ($self, $key, $value)
Creates a new sub entry with the given key and value, and then adds that as a child.

Returns the child added.

  add_comment ($key, $value)
Creates a new comment with the given key and value, and then adds that as a child.

Returns the child added.

  ancestor()
Returns the top Header object and depth of this child

  strict_quotes()
Return the current value of strict quotes flag for this header or for its ancestor if not set locally

If true, we are stricter about which characters result in a quoted string

  set_strict_quotes( $value )
Set the value of strict quotes

If true, we are stricter about which characters result in a quoted string

Default false

  as_string_prefix( $header )
Add the prefix to as_string for this object when calledas a child of another objects as_string method call.

  as_json()
Return this instance as a JSON serialised string

  as_string()
Returns this instance as a string.

  build_string( $header )
Build a string using the supplied Mail::AuthenticationResults::FoldableHeader object.

  search( $search )
Apply search rules in $search to this instance and return a Mail::AuthenticationResults::Header::Group object containing the matches.

$search is a HASHREF with the following possible key/value pairs

key Match if the instance key matches the supplied value (string or regex)

value
    Match if the instance value matches the supplied value (string or regex)

isa Match is the instance class typs matches the supplied value. This is a lowercase version of the class type, (comment,entry,subentry,etc))

has An arrayref of searches, match this class if the supplied search queries would return at least 1 result each

AUTHOR
Marc Bradshaw <marc@marcbradshaw.net>

COPYRIGHT AND LICENSE
This software is copyright (c) 2021 by Marc Bradshaw.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.