Commit d32d787

mo <mo.khan@gmail.com>
2017-12-15 04:02:28
extract encrypt? method.
1 parent 2c12390
Changed files (1)
lib
lib/saml/kit/templatable.rb
@@ -21,7 +21,7 @@ module Saml
       end
 
       def encryption_for(xml:)
-        if encrypt && encryption_certificate
+        if encrypt?
           temp = ::Builder::XmlMarkup.new
           yield temp
           xml_encryption = Saml::Kit::Builders::XmlEncryption.new(temp.target!, encryption_certificate.public_key)
@@ -31,6 +31,10 @@ module Saml
         end
       end
 
+      def encrypt?
+        encrypt && encryption_certificate
+      end
+
       def render(model, options)
         Saml::Kit::Template.new(model).to_xml(options)
       end