Class: Policygen::Renderer

Inherits:
Object
  • Object
show all
Defined in:
lib/policygen/renderer.rb

Instance Method Summary collapse

Constructor Details

#initializeRenderer

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_policyObject



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_serviceObject



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