Module: Saml2::Assertion::Parsing

Included in:
Saml2::Assertion
Defined in:
lib/saml2/assertion.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.item(name, xpath) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/saml2/assertion.rb', line 11

def self.item(name, xpath)
  module_eval("  def \#{name}_from(node)\n    target_node = node.at('\#{xpath}')\n    raise InvalidAssertionError, \"\#{name} missing (xpath: `\#{xpath}`)\" unless target_node\n    \n    target_node.content.strip\n  end\n  ITEM_METH\nend\n")

Instance Method Details

#each_attribute_node_from(doc, &blk) ⇒ Object



27
28
29
30
31
# File 'lib/saml2/assertion.rb', line 27

def each_attribute_node_from(doc, &blk)
  attribute_nodes = doc.search('//asrt:Assertion/asrt:AttributeStatement/asrt:Attribute')
   
  attribute_nodes.each &blk
end