Class: Shibkit::MetaMeta::Contact
- Inherits:
-
MetadataItem
- Object
- MetadataItem
- Shibkit::MetaMeta::Contact
- Defined in:
- lib/shibkit/meta_meta/contact.rb
Overview
Class to represent technical or suppor contact details for an entity
Constant Summary collapse
- ROOT_ELEMENT =
Element and attribute used to select XML for new objects
'ContactPerson'
- TARGET_ATTR =
'contactType'
- REQUIRED_QUACKS =
[:email_url, :category]
Constants inherited from MetadataItem
Instance Attribute Summary collapse
-
#category ⇒ Object
The category of the contact (support or technical).
-
#email_url ⇒ Object
The email address of the contact formatted as a mailto: URL.
-
#givenname ⇒ Object
The given name of the contact (often the entire name is here).
-
#surname ⇒ Object
The surname of the contact.
Attributes inherited from MetadataItem
Instance Method Summary collapse
-
#display_name ⇒ Object
Usually both the surname and givenname of the contact.
- #email_address ⇒ Object
-
#to_s ⇒ Object
Nicer presentation as a string.
Methods inherited from MetadataItem
#filter, #from_xml, #hashed_id, #initialize, #parsed_xml, #purge_xml, #source_xml, #textify_xml, #to_hash, #to_rdf, #to_xml
Constructor Details
This class inherits a constructor from Shibkit::MetaMeta::MetadataItem
Instance Attribute Details
#category ⇒ Object
The category of the contact (support or technical)
42 43 44 |
# File 'lib/shibkit/meta_meta/contact.rb', line 42 def category @category end |
#email_url ⇒ Object
The email address of the contact formatted as a mailto: URL
39 40 41 |
# File 'lib/shibkit/meta_meta/contact.rb', line 39 def email_url @email_url end |
#givenname ⇒ Object
The given name of the contact (often the entire name is here)
33 34 35 |
# File 'lib/shibkit/meta_meta/contact.rb', line 33 def givenname @givenname end |
#surname ⇒ Object
The surname of the contact
36 37 38 |
# File 'lib/shibkit/meta_meta/contact.rb', line 36 def surname @surname end |
Instance Method Details
#display_name ⇒ Object
Usually both the surname and givenname of the contact
45 46 47 48 49 |
# File 'lib/shibkit/meta_meta/contact.rb', line 45 def display_name return [givenname, surname].join(' ') end |
#email_address ⇒ Object
51 52 53 54 55 |
# File 'lib/shibkit/meta_meta/contact.rb', line 51 def email_address return email_url.gsub('mailto:','') end |
#to_s ⇒ Object
Nicer presentation as a string
58 59 60 61 62 |
# File 'lib/shibkit/meta_meta/contact.rb', line 58 def to_s return "#{display_name} <#{email_address}>" end |