Class: Saml::ComplexTypes::StatementAbstractType

Inherits:
Object
  • Object
show all
Includes:
HappyMapper
Defined in:
lib/saml/complex_types/statement_abstract_type.rb

Class Method Summary collapse

Class Method Details

.parse(xml, options = {}) ⇒ Object

TODO: handle multiple statements with different types



22
23
24
25
26
27
28
29
30
31
# File 'lib/saml/complex_types/statement_abstract_type.rb', line 22

def self.parse(xml, options = {})
  statements = Array(super)
  statements.collect do |statement|
    if (type = types[statement.type])
      type.parse(xml, options.merge(single: true))
    else
      statement
    end
  end
end

.register_type(type, klass) ⇒ Object



13
14
15
# File 'lib/saml/complex_types/statement_abstract_type.rb', line 13

def self.register_type(type, klass)
  types[type] = klass
end

.typesObject



17
18
19
# File 'lib/saml/complex_types/statement_abstract_type.rb', line 17

def self.types
  @types ||= {}
end