Class: Policygen::Renderer
- Inherits:
-
Object
- Object
- Policygen::Renderer
- Defined in:
- lib/policygen/renderer.rb
Instance Method Summary collapse
-
#initialize ⇒ Renderer
constructor
A new instance of Renderer.
- #privacy_policy ⇒ Object
- #terms_of_service ⇒ Object
Constructor Details
#initialize ⇒ Renderer
Returns a new instance of Renderer.
9 10 11 12 13 14 15 16 |
# File 'lib/policygen/renderer.rb', line 9 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 |
Instance Method Details
#privacy_policy ⇒ Object
18 19 20 21 |
# File 'lib/policygen/renderer.rb', line 18 def privacy_policy template = File.read(File.join(File.dirname(__FILE__), "../templates", "privacy_policy.html.erb")) ERB.new(template).result(binding) end |
#terms_of_service ⇒ Object
23 24 25 26 |
# File 'lib/policygen/renderer.rb', line 23 def terms_of_service template = File.read(File.join(File.dirname(__FILE__), "../templates", "tos.html.erb")) ERB.new(template).result(binding) end |