Class: SAML2::Entity::Group
- Includes:
- Enumerable, Signable
- Defined in:
- lib/saml2/entity.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#from_xml(node) ⇒ void
Parse an XML element into this object.
- #id ⇒ String
-
#initialize ⇒ Group
constructor
A new instance of Group.
-
#valid_schema? ⇒ Boolean
If the XML is valid according to SAML XSDs.
- #valid_until ⇒ Time?
Methods included from Signable
#sign, #signature, #signed?, #signing_key, #valid_signature?, #validate_signature
Methods inherited from Base
#build, #decrypt, from_xml, #inspect, load_object_array, load_string_array, lookup_qname, #to_s, #to_xml
Constructor Details
#initialize ⇒ Group
Returns a new instance of Group.
50 51 52 53 54 |
# File 'lib/saml2/entity.rb', line 50 def initialize @entities = [] @id = "_#{SecureRandom.uuid}" @valid_until = nil end |
Instance Method Details
#from_xml(node) ⇒ void
This method returns an undefined value.
Parse an XML element into this object.
57 58 59 60 61 62 63 64 |
# File 'lib/saml2/entity.rb', line 57 def from_xml(node) super @id = nil remove_instance_variable(:@valid_until) @entities = Base.load_object_array(xml, "md:EntityDescriptor|md:EntitiesDescriptor", 'EntityDescriptor' => Entity, 'EntitiesDescriptor' => Group) end |
#id ⇒ String
72 73 74 |
# File 'lib/saml2/entity.rb', line 72 def id @id ||= xml['ID'] end |
#valid_schema? ⇒ Boolean
If the XML is valid according to SAML XSDs.
67 68 69 |
# File 'lib/saml2/entity.rb', line 67 def valid_schema? Schemas.federation.valid?(xml.document) end |
#valid_until ⇒ Time?
77 78 79 80 81 82 |
# File 'lib/saml2/entity.rb', line 77 def valid_until unless instance_variable_defined?(:@valid_until) @valid_until = xml['validUntil'] && Time.parse(xml['validUntil']) end @valid_until end |