Commit d4c91d6
Changed files (2)
lib
saml
kit
core_ext
lib/saml/kit/core_ext/assertion.rb
@@ -1,16 +1,22 @@
module Saml
module Kit
class Assertion
+ TABLE = {
+ 'Assertion Present?' => ->(x) { x.present? },
+ 'Issuer' => ->(x) { x.issuer },
+ 'Name Id' => ->(x) { x.name_id },
+ 'Attributes' => ->(x) { x.attributes.inspect },
+ 'Not Before' => ->(x) { x.started_at },
+ 'Not After' => ->(x) { x.expired_at },
+ 'Audiences' => ->(x) { x.audiences.inspect },
+ 'Encrypted?' => ->(x) { x.encrypted? },
+ 'Decryptable' => ->(x) { x.decryptable? },
+ }.freeze
+
def build_table(table = [])
- table.push(['Assertion Present?', present?])
- table.push(['Issuer', issuer])
- table.push(['Name Id', name_id])
- table.push(['Attributes', attributes.inspect])
- table.push(['Not Before', started_at])
- table.push(['Not After', expired_at])
- table.push(['Audiences', audiences.inspect])
- table.push(['Encrypted?', encrypted?])
- table.push(['Decryptable', decryptable?])
+ TABLE.each do |key, callable|
+ table.push([key, callable.call(self)])
+ end
signature.build_table(table)
end
end
.rubocop.yml
@@ -68,6 +68,12 @@ Style/EachWithObject:
Style/StringLiterals:
EnforcedStyle: 'single_quotes'
+Style/TrailingCommaInArrayLiteral:
+ Enabled: false
+
+Style/TrailingCommaInHashLiteral:
+ Enabled: false
+
RSpec/MultipleExpectations:
Enabled: false