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 55 |
# File 'lib/saml2/entity.rb', line 50 def initialize super @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.
58 59 60 61 62 63 64 65 66 |
# File 'lib/saml2/entity.rb', line 58 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
74 75 76 |
# File 'lib/saml2/entity.rb', line 74 def id @id ||= xml["ID"] end |
#valid_schema? ⇒ Boolean
If the XML is valid according to SAML XSDs.
69 70 71 |
# File 'lib/saml2/entity.rb', line 69 def valid_schema? Schemas..valid?(xml.document) end |
#valid_until ⇒ Time?
79 80 81 82 83 84 |
# File 'lib/saml2/entity.rb', line 79 def valid_until unless instance_variable_defined?(:@valid_until) @valid_until = xml["validUntil"] && Time.parse(xml["validUntil"]) end @valid_until end |