View Source SmeeView.Aspects.OrganizationDisplayname (SmeeView v0.2.1)

Represents and processes <OrganizationDisplayName> 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.

Summary

Functions

Is this aspect relevant to the IdP role?

Returns the language of this aspect (as a two letter ISO 639-1 code)

Is the aspect using this language? (two letter ISO 639-1 code)

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

Is this aspect relevant to the SP role?

Returns the text for the aspect.

Types

@type t() :: %SmeeView.Aspects.OrganizationDisplayname{lang: binary(), text: binary()}

Functions

@spec 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.

OrganizationDisplayname.idp?(aspect)
# => true
@spec lang(aspect :: t()) :: binary()

Returns the language of this aspect (as a two letter ISO 639-1 code)

If no language code has been set for this aspect then the default language code will be returned.

OrganizationDisplayname.lang(aspect)
# => "fr"
Link to this function

lang?(aspect, lang \\ SmeeView.Utils.default_lang())

View Source

Is the aspect using this language? (two letter ISO 639-1 code)

Returns true if the provided code matches that of the aspect.

If no language code has been set for this aspect then the aspect will be assumed to have the default language code.

OrganizationDisplayname.lang?(aspect, "en")
# => false
@spec 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.

OrganizationDisplayname.role(aspect)
# => :idp
@spec 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.

OrganizationDisplayname.sp?(aspect)
# => false
@spec text(aspect :: t()) :: binary()

Returns the text for the aspect.

If you are trying to show the text for a particular language then use a function from the matching View instead, and provide a list of aspects for it to choose from.

Aspects containing text are printable and can be converted to strings using Kernel.to_string/1 or interpolated into another string.

OrganizationDisplayname.text(aspect)
# => "Example University IdP"