Class: SAML::Core::Attribute

Inherits:
Object
  • Object
show all
Defined in:
lib/saml/core/attribute.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#attribute_valuesObject

Returns the value of attribute attribute_values.



7
8
9
# File 'lib/saml/core/attribute.rb', line 7

def attribute_values
  @attribute_values
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/saml/core/attribute.rb', line 5

def name
  @name
end

#name_formatObject

Returns the value of attribute name_format.



6
7
8
# File 'lib/saml/core/attribute.rb', line 6

def name_format
  @name_format
end

Class Method Details

.from_xml(xml) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/saml/core/attribute.rb', line 9

def self.from_xml(xml)
  attribute = new
  attribute.name = xml.attributes['Name']
  
  nf = xml.attributes['NameFormat']
  attribute.name_format = nf.nil? ? 'urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified' : nf
  
  values = []
  xml.each_element() do |av|
    values << av.to_s
  end
  attribute.attribute_values = values
  attribute
end