SmeeView.Aspects.Publication (SmeeView v0.1.0) View Source

Represents and processes <mdrpi:Publication> elements in entity metadata as Aspect structs.

The functions in this module are intended to be applied to individual Aspect structs - for extracting and processing collections of these records please use the matching View module.

Link to this section Summary

Functions

Is this aspect relevant to the IdP role?

Returns the publication ID as a binary string.

Returns the URI ID of the publisher as a binary string.

Returns the associated role for this aspect: :sp, :idp or :all

Is this aspect relevant to the SP role?

Link to this section Types

Specs

t() :: %SmeeView.Aspects.Publication{
  publication_id: binary(),
  publisher: binary()
}

Link to this section Functions

Specs

idp?(aspect :: t()) :: boolean()

Is this aspect relevant to the IdP role?

Will return true if the aspect has been derived from an IdP role, or is applicable to all roles.

Publication.idp?(aspect)
# => true

Specs

publication_id(aspect :: t()) :: binary()

Returns the publication ID as a binary string.

Publication.publication_id(aspect)
# => "k3klsoi"

Specs

publisher(aspect :: t()) :: binary()

Returns the URI ID of the publisher as a binary string.

Publication.publisher(aspect)
# => "urn:mace:switch.ch:SWITCHaai"

Specs

role(aspect :: t()) :: atom()

Returns the associated role for this aspect: :sp, :idp or :all

The role type is useful when handling a mixed list of aspects that may be specific to certain roles of an entity.

Publication.role(aspect)
# => :idp

Specs

sp?(aspect :: t()) :: boolean()

Is this aspect relevant to the SP role?

Will return true if the aspect has been derived from an SP role, or is applicable to all roles.

Publication.sp?(aspect)
# => false