Class: SAML2::RequestedAttribute
- Defined in:
- lib/saml2/attribute_consuming_service.rb
Instance Attribute Summary
Attributes inherited from Attribute
#friendly_name, #name, #name_format, #value
Attributes inherited from Base
Class Method Summary collapse
-
.create(name, is_required = nil) ⇒ RequestedAttribute
Create a RequestAttribute object to represent an attribute.
-
.element ⇒ 'RequestedAttribute'
The XML element that this attribute class serializes as.
-
.namespace ⇒ 'md'
The XML namespace that this attribute class serializes as.
Instance Method Summary collapse
-
#from_xml(node) ⇒ void
Parse an XML element into this object.
-
#initialize(name = nil, is_required = nil, friendly_name = nil, name_format = nil) ⇒ RequestedAttribute
constructor
Create a new RequestedAttribute.
- #required? ⇒ true, ...
Methods inherited from Attribute
Methods inherited from Base
#build, #decrypt, from_xml, #inspect, load_object_array, load_string_array, lookup_qname, #to_s, #to_xml
Constructor Details
#initialize(name = nil, is_required = nil, friendly_name = nil, name_format = nil) ⇒ RequestedAttribute
Create a new SAML2::RequestedAttribute.
46 47 48 49 |
# File 'lib/saml2/attribute_consuming_service.rb', line 46 def initialize(name = nil, is_required = nil, friendly_name = nil, name_format = nil) super(name, nil, friendly_name, name_format) @is_required = is_required end |
Class Method Details
.create(name, is_required = nil) ⇒ RequestedAttribute
Create a RequestAttribute object to represent an attribute.
Attribute.create will be used to create a temporary object, so that attribute-class specific inferences (i.e. Attribute::X500 friendly names) will be done, but always returns a SAML2::RequestedAttribute.
34 35 36 37 |
# File 'lib/saml2/attribute_consuming_service.rb', line 34 def create(name, is_required = nil) attribute = Attribute.create(name) new(attribute.name, is_required, attribute.friendly_name, attribute.name_format) end |
.element ⇒ 'RequestedAttribute'
The XML element that this attribute class serializes as.
21 22 23 |
# File 'lib/saml2/attribute_consuming_service.rb', line 21 def element "RequestedAttribute" end |
.namespace ⇒ 'md'
The XML namespace that this attribute class serializes as.
15 16 17 |
# File 'lib/saml2/attribute_consuming_service.rb', line 15 def namespace "md" end |
Instance Method Details
#from_xml(node) ⇒ void
This method returns an undefined value.
Parse an XML element into this object.
52 53 54 55 |
# File 'lib/saml2/attribute_consuming_service.rb', line 52 def from_xml(node) super @is_required = node["isRequired"] && node["isRequired"] == "true" end |
#required? ⇒ true, ...
58 59 60 |
# File 'lib/saml2/attribute_consuming_service.rb', line 58 def required? @is_required end |