Sha256: 09d5dabe710161d9c88a156a0732112df05215b1d9f7af2cf2f5bffb3bd4a960
Contents?: true
Size: 903 Bytes
Versions: 1
Compression:
Stored size: 903 Bytes
Contents
# frozen_string_literal: true require "i18n" require "erb" require_relative "css/tailwind" module Policygen class Renderer def initialize @config = Policygen.config @css = css unless I18n.load_path.include?(File.join(File.dirname(__FILE__), "../locales", "en.yml")) I18n.load_path += Dir[File.join(File.dirname(__FILE__), "../locales", "*.yml")] end end def privacy_policy template = File.read(File.join(File.dirname(__FILE__), "../templates", "privacy_policy.html.erb")) ERB.new(template).result(binding) end def terms_of_service template = File.read(File.join(File.dirname(__FILE__), "../templates", "tos.html.erb")) ERB.new(template).result(binding) end private def css return Policygen::Css::Tailwind.new if @config.css_framework == :tailwind Policygen::Css::Classes.new end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
policygen-0.1.0 | lib/policygen/renderer.rb |