Sha256: 8320a4cefc3f0e83dbd1ca88dae2117da75a75a02d4a5d4f171d092a73952c43

Contents?: true

Size: 755 Bytes

Versions: 6

Compression:

Stored size: 755 Bytes

Contents

require 'saml2/contact'
require 'saml2/organization'

module SAML2
  module OrganizationAndContacts
    attr_writer :organization, :contacts

    def initialize(node = nil)
      unless node
        @organization = nil
        @contacts = []
      end
    end

    def organization
      unless instance_variable_defined?(:@organization)
        @organization = Organization.from_xml(@root.at_xpath('md:Organization', Namespaces::ALL))
      end
      @organization
    end

    def contacts
      @contacts ||= load_object_array(@root, 'md:ContactPerson', Contact)
    end

    protected

    def build(builder)
      organization.build(builder) if organization
      contacts.each do |contact|
        contact.build(builder)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
saml2-1.0.5 lib/saml2/organization_and_contacts.rb
saml2-1.0.4 lib/saml2/organization_and_contacts.rb
saml2-1.0.3 lib/saml2/organization_and_contacts.rb
saml2-1.0.2 lib/saml2/organization_and_contacts.rb
saml2-1.0.1 lib/saml2/organization_and_contacts.rb
saml2-1.0.0 lib/saml2/organization_and_contacts.rb