Class: Saml::Kit::Conditions

Inherits:
Object
  • Object
show all
Includes:
XmlParseable
Defined in:
lib/saml/kit/conditions.rb

Constant Summary

Constants included from XmlParseable

XmlParseable::NAMESPACES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from XmlParseable

#present?, #to_h, #to_s, #to_xhtml, #to_xml

Constructor Details

#initialize(node) ⇒ Conditions

Returns a new instance of Conditions.



10
11
12
13
# File 'lib/saml/kit/conditions.rb', line 10

def initialize(node)
  @to_nokogiri = node
  @content = node.to_s
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



8
9
10
# File 'lib/saml/kit/conditions.rb', line 8

def content
  @content
end

Instance Method Details

#audiencesObject



23
24
25
# File 'lib/saml/kit/conditions.rb', line 23

def audiences
  search('./saml:AudienceRestriction/saml:Audience').map(&:text)
end

#expired_atObject



19
20
21
# File 'lib/saml/kit/conditions.rb', line 19

def expired_at
  parse_iso8601(at_xpath('./@NotOnOrAfter').try(:value))
end

#started_atObject



15
16
17
# File 'lib/saml/kit/conditions.rb', line 15

def started_at
  parse_iso8601(at_xpath('./@NotBefore').try(:value))
end