Class: SAML2::AttributeStatement

Inherits:
Base
  • Object
show all
Defined in:
lib/saml2/attribute.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

from_xml, load_object_array, load_string_array, lookup_qname, #to_s, #to_xml

Constructor Details

#initialize(attributes = []) ⇒ AttributeStatement

Returns a new instance of AttributeStatement.



122
123
124
# File 'lib/saml2/attribute.rb', line 122

def initialize(attributes = [])
  @attributes = attributes
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



120
121
122
# File 'lib/saml2/attribute.rb', line 120

def attributes
  @attributes
end

Instance Method Details

#build(builder) ⇒ Object



132
133
134
135
136
137
# File 'lib/saml2/attribute.rb', line 132

def build(builder)
  builder['saml'].AttributeStatement('xmlns:xs' => Namespaces::XS,
                                     'xmlns:xsi' => Namespaces::XSI) do |builder|
    @attributes.each { |attr| attr.build(builder) }
  end
end

#from_xml(node) ⇒ Object



126
127
128
129
130
# File 'lib/saml2/attribute.rb', line 126

def from_xml(node)
  @attributes = node.xpath('saml:Attribute', Namespaces::ALL).map do |attr|
    Attribute.from_xml(attr)
  end
end