Class: Shibkit::MetaMeta::Provider
- Inherits:
-
MetadataItem
- Object
- MetadataItem
- Shibkit::MetaMeta::Provider
- Defined in:
- lib/shibkit/meta_meta/provider.rb
Overview
Class to represent the metadata of a Shibboleth IDP or SP
Constant Summary collapse
- ROOT_ELEMENT =
Element and attribute used to select XML for new objects
'EntityDescriptor'
- TARGET_ATTR =
'entityID'
- REQUIRED_QUACKS =
[:entity_uri]
- MDUI_ROOT =
'NotSpecified'
Constants inherited from MetadataItem
Instance Attribute Summary collapse
-
#descriptions ⇒ Object
Returns the value of attribute descriptions.
-
#display_names ⇒ Object
Returns the value of attribute display_names.
-
#domains ⇒ Object
Returns the value of attribute domains.
-
#entity_uri ⇒ Object
(also: #uri, #entity_id)
The URI of the entity.
-
#geolocation_urls ⇒ Object
Returns the value of attribute geolocation_urls.
-
#info_urls ⇒ Object
Returns the value of attribute info_urls.
-
#ip_blocks ⇒ Object
Returns the value of attribute ip_blocks.
-
#keyword_sets ⇒ Object
Returns the value of attribute keyword_sets.
-
#organisation ⇒ Object
Returns the value of attribute organisation.
-
#privacy_urls ⇒ Object
Returns the value of attribute privacy_urls.
-
#valid ⇒ Object
(also: #valid?)
readonly
Returns the value of attribute valid.
Attributes inherited from MetadataItem
Instance Method Summary collapse
- #description(lang = :en) ⇒ Object
- #display_name(lang = :en) ⇒ Object
- #info_url(lang = :en) ⇒ Object
- #keywords(lang = :en) ⇒ Object
- #logos(lang = :en) ⇒ Object
- #privacy_url(lang = :en) ⇒ Object
- #purge_xml(cascade = true) ⇒ Object
- #textify_xml(cascade = true) ⇒ Object
- #to_s ⇒ Object
Methods inherited from MetadataItem
#filter, #from_xml, #hashed_id, #initialize, #parsed_xml, #source_xml, #to_hash, #to_rdf, #to_xml
Constructor Details
This class inherits a constructor from Shibkit::MetaMeta::MetadataItem
Instance Attribute Details
#descriptions ⇒ Object
Returns the value of attribute descriptions.
41 42 43 |
# File 'lib/shibkit/meta_meta/provider.rb', line 41 def descriptions @descriptions end |
#display_names ⇒ Object
Returns the value of attribute display_names.
39 40 41 |
# File 'lib/shibkit/meta_meta/provider.rb', line 39 def display_names @display_names end |
#domains ⇒ Object
Returns the value of attribute domains.
51 52 53 |
# File 'lib/shibkit/meta_meta/provider.rb', line 51 def domains @domains end |
#entity_uri ⇒ Object Also known as: uri, entity_id
The URI of the entity
36 37 38 |
# File 'lib/shibkit/meta_meta/provider.rb', line 36 def entity_uri @entity_uri end |
#geolocation_urls ⇒ Object
Returns the value of attribute geolocation_urls.
53 54 55 |
# File 'lib/shibkit/meta_meta/provider.rb', line 53 def geolocation_urls @geolocation_urls end |
#info_urls ⇒ Object
Returns the value of attribute info_urls.
45 46 47 |
# File 'lib/shibkit/meta_meta/provider.rb', line 45 def info_urls @info_urls end |
#ip_blocks ⇒ Object
Returns the value of attribute ip_blocks.
49 50 51 |
# File 'lib/shibkit/meta_meta/provider.rb', line 49 def ip_blocks @ip_blocks end |
#keyword_sets ⇒ Object
Returns the value of attribute keyword_sets.
43 44 45 |
# File 'lib/shibkit/meta_meta/provider.rb', line 43 def keyword_sets @keyword_sets end |
#organisation ⇒ Object
Returns the value of attribute organisation.
57 58 59 |
# File 'lib/shibkit/meta_meta/provider.rb', line 57 def organisation @organisation end |
#privacy_urls ⇒ Object
Returns the value of attribute privacy_urls.
47 48 49 |
# File 'lib/shibkit/meta_meta/provider.rb', line 47 def privacy_urls @privacy_urls end |
#valid ⇒ Object (readonly) Also known as: valid?
Returns the value of attribute valid.
55 56 57 |
# File 'lib/shibkit/meta_meta/provider.rb', line 55 def valid @valid end |
Instance Method Details
#description(lang = :en) ⇒ Object
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/shibkit/meta_meta/provider.rb', line 85 def description(lang=:en) return descriptions[lang] unless descriptions[lang].to_s.empty? if self.kind_of?(Shibkit::MetaMeta::SP) and default_service return default_service.description(lang) unless default_service.description(lang).to_s.empty? end if organisation return organisation.display_name unless organisation.display_name.to_s.empty? return organisation.name unless organisation.name.to_s.empty? end return "" end |
#display_name(lang = :en) ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/shibkit/meta_meta/provider.rb', line 68 def display_name(lang=:en) return display_names[lang] unless display_names[lang].to_s.empty? if self.kind_of?(Shibkit::MetaMeta::SP) and default_service return self.default_service.name[lang] unless default_service.name[lang].to_s.empty? end if organisation return organisation.display_name unless organisation.display_name.to_s.empty? return [organisation.name, "service"].join(' ') unless organisation.name.to_s.empty? end return entity_id end |
#info_url(lang = :en) ⇒ Object
108 109 110 111 112 |
# File 'lib/shibkit/meta_meta/provider.rb', line 108 def info_url(lang=:en) return info_urls[lang] || nil end |
#keywords(lang = :en) ⇒ Object
102 103 104 105 106 |
# File 'lib/shibkit/meta_meta/provider.rb', line 102 def keywords(lang=:en) return keyword_sets[lang] || [] end |
#logos(lang = :en) ⇒ Object
120 121 122 123 124 |
# File 'lib/shibkit/meta_meta/provider.rb', line 120 def logos(lang=:en) return logos[lang] || [] end |
#privacy_url(lang = :en) ⇒ Object
114 115 116 117 118 |
# File 'lib/shibkit/meta_meta/provider.rb', line 114 def privacy_url(lang=:en) return privacy_urls[lang] || nil end |
#purge_xml(cascade = true) ⇒ Object
126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/shibkit/meta_meta/provider.rb', line 126 def purge_xml(cascade=true) super return unless cascade @logos.values.each do |logo_set| logo_set.each { |logo| logo.purge_xml(cascade)} end end |
#textify_xml(cascade = true) ⇒ Object
140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/shibkit/meta_meta/provider.rb', line 140 def textify_xml(cascade=true) super return unless cascade @logos.values.each do |logo_set| logo_set.each { |logo| logo.textify_xml(cascade)} end end |
#to_s ⇒ Object
62 63 64 65 66 |
# File 'lib/shibkit/meta_meta/provider.rb', line 62 def to_s return uri end |