Sha256: 7c8f5cf9a9790fde576b2e4d38dd5a566945b8c1b96b1013f9909752904245d5

Contents?: true

Size: 894 Bytes

Versions: 2

Compression:

Stored size: 894 Bytes

Contents

module Saml
  module Elements
    class ContactPerson
      include Saml::Base

      tag 'ContactPerson'
      namespace 'md'

      module ContactTypes
        TECHNICAL = 'technical'
        SUPPORT = 'support'
        ADMINISTRATIVE = 'administrative'
        BILLING = 'billing'
        OTHER = 'other'

        ALL = [TECHNICAL, SUPPORT, ADMINISTRATIVE, BILLING, OTHER]
      end

      attribute :contact_type, String, :tag => "ContactType"

      element :company, String, :tag => "Company"
      element :given_name, String, :tag => "GivenName"
      element :sur_name, String, :tag => "SurName"

      has_many :email_addresses, String, :tag => "EmailAddress"
      has_many :telephone_numbers, String, :tag => "TelephoneNumber"

      validates :contact_type, :inclusion => ContactTypes::ALL

      validates :email_addresses, :telephone_numbers, :presence => true
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
libsaml-2.0.6 lib/saml/elements/contact_person.rb
libsaml-2.0.5 lib/saml/elements/contact_person.rb