View Source SmeeView.Aspects.Keywords (SmeeView v0.2.1)
Represents and processes <mdui:Keywords> 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?
Lists all keywords in this set as a single binary string
Returns the keywords in one keyword set as a list of strings
Types
Functions
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.
Keywords.idp?(aspect)
# => true
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.
Keywords.lang(aspect)
# => "fr"
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.
Keywords.lang?(aspect, "en")
# => false
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.
Keywords.role(aspect)
# => :idp
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.
Keywords.sp?(aspect)
# => false
Lists all keywords in this set as a single binary string
Keywords.text(aspect)
# => "GÉANT geant Terena Dante"
Returns the keywords in one keyword set as a list of strings
Keywords.words(aspect)
# => ["GÉANT", "geant", "Terena" "Dante"]