main
 1# frozen_string_literal: true
 2
 3module Saml
 4  module Kit
 5    class Document
 6      TABLE = {
 7        'ID' => ->(x) { x.id },
 8        'Issuer' => ->(x) { x.issuer },
 9        'Version' => ->(x) { x.version },
10        'Issue Instant' => ->(x) { x.issue_instant.iso8601 },
11        'Type' => ->(x) { x.name },
12        'Valid' => ->(x) { x.valid? },
13        'Signed?' => ->(x) { x.signed? },
14        'Trusted?' => ->(x) { x.trusted? },
15      }.freeze
16
17      def build_table(table = [])
18        TABLE.each do |key, callable|
19          table.push([key, callable.call(self)])
20        end
21        signature.build_table(table)
22      end
23    end
24  end
25end