Class: EnvCompare::Template
- Inherits:
-
Object
- Object
- EnvCompare::Template
- Defined in:
- lib/env_compare/template.rb
Instance Method Summary collapse
-
#initialize(data:, headers:, theme_base_path:) ⇒ Template
constructor
A new instance of Template.
- #render(path) ⇒ Object
Constructor Details
#initialize(data:, headers:, theme_base_path:) ⇒ Template
Returns a new instance of Template.
6 7 8 9 10 |
# File 'lib/env_compare/template.rb', line 6 def initialize(data:, headers:, theme_base_path:) @data = data @headers = headers @theme_base_path = theme_base_path end |
Instance Method Details
#render(path) ⇒ Object
12 13 14 15 16 |
# File 'lib/env_compare/template.rb', line 12 def render(path) content = File.read(File.join(@theme_base_path, path)) t = ERB.new(content) t.result(binding) end |