lib/saml/kit/signature.rb in saml-kit-1.0.14 vs lib/saml/kit/signature.rb in saml-kit-1.0.15

- old
+ new

@@ -1,9 +1,12 @@ # frozen_string_literal: true module Saml module Kit + # This class is responsible for + # validating an xml digital signature + # in an xml document. class Signature include ActiveModel::Validations include Translatable validate :validate_signature @@ -32,12 +35,12 @@ def digest_value at_xpath('./ds:SignedInfo/ds:Reference/ds:DigestValue').try(:text) end def expected_digest_value - digests = dsignature.references.map do |x| - Base64.encode64(x.calculate_digest_value).chomp + digests = dsignature.references.map do |xxx| + Base64.encode64(xxx.calculate_digest_value).chomp end digests.count > 1 ? digests : digests[0] end def digest_method @@ -67,11 +70,15 @@ def present? node.present? end - def to_xml(pretty: false) - pretty ? node.to_xml(indent: 2) : node.to_s + def to_xml(pretty: nil) + pretty ? node.to_xml(indent: 2) : to_s + end + + def to_s + node.to_s end private attr_reader :node