Class: SAML2::AttributeStatement

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

Instance Attribute Summary collapse

Attributes inherited from Base

#xml

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.



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

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

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



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

def attributes
  @attributes
end

Instance Method Details

#build(builder) ⇒ Object



134
135
136
137
138
139
# File 'lib/saml2/attribute.rb', line 134

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

#from_xml(node) ⇒ Object



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

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