Sha256: 084b9e252ed2fdc430cffb51848e0284969375d66371405f4548b1350efed7f3

Contents?: true

Size: 573 Bytes

Versions: 11

Compression:

Stored size: 573 Bytes

Contents

module Saml
  module Kit
    class Template
      attr_reader :target

      def initialize(target)
        @target = target
      end

      def to_xml(options)
        template.render(target, options)
      end

      private

      def template_name
        "#{target.class.name.split("::").last.underscore}.builder"
      end

      def template_path
        root_path = File.expand_path(File.dirname(__FILE__))
        File.join(root_path, "builders/templates/", template_name)
      end

      def template
        Tilt.new(template_path)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
saml-kit-0.2.14 lib/saml/kit/template.rb
saml-kit-0.2.13 lib/saml/kit/template.rb
saml-kit-0.2.12 lib/saml/kit/template.rb
saml-kit-0.2.11 lib/saml/kit/template.rb
saml-kit-0.2.10 lib/saml/kit/template.rb
saml-kit-0.2.9 lib/saml/kit/template.rb
saml-kit-0.2.8 lib/saml/kit/template.rb
saml-kit-0.2.7 lib/saml/kit/template.rb
saml-kit-0.2.6 lib/saml/kit/template.rb
saml-kit-0.2.5 lib/saml/kit/template.rb
saml-kit-0.2.4 lib/saml/kit/template.rb