class Shibkit::MetaMeta::Contact

Class to represent technical or suppor contact details for an entity

Constants

REQUIRED_QUACKS
ROOT_ELEMENT

Element and attribute used to select XML for new objects

TARGET_ATTR

Attributes

category[RW]

The category of the contact (support or technical)

email_url[RW]

The email address of the contact formatted as a mailto: URL

givenname[RW]

The given name of the contact (often the entire name is here)

surname[RW]

The surname of the contact

Public Instance Methods

display_name() click to toggle source

Usually both the surname and givenname of the contact

# File lib/shibkit/meta_meta/contact.rb, line 45
def display_name

  return [givenname, surname].join(' ')

end
email_address() click to toggle source
# File lib/shibkit/meta_meta/contact.rb, line 51
def email_address
  
  return email_url.gsub('mailto:','')
  
end
to_s() click to toggle source

Nicer presentation as a string

# File lib/shibkit/meta_meta/contact.rb, line 58
def to_s
  
  return "#{display_name} <#{email_address}>"
 
end

Private Instance Methods

parse_xml() click to toggle source
# File lib/shibkit/meta_meta/contact.rb, line 66
def parse_xml
  
  if @noko and @noko.content
       
    self.givenname = @noko.xpath('xmlns:GivenName[1]')[0].content    if @noko.xpath('xmlns:GivenName[1]')[0]
    self.surname   = @noko.xpath('xmlns:SurName[1]')[0].content      if @noko.xpath('xmlns:SurName[1]')[0]
    self.email_url = @noko.xpath('xmlns:EmailAddress[1]')[0].content if @noko.xpath('xmlns:EmailAddress[1]')[0]
    self.category  = @noko['contactType'].to_sym
  
    log.debug "  Derived contact #{email_url} from XML"
  
  end
  
  
  
end