Class: Wright::Util::FileRenderer Private
- Inherits:
-
Object
- Object
- Wright::Util::FileRenderer
- Defined in:
- lib/wright/util/file_renderer.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
File renderer.
Instance Method Summary collapse
-
#initialize(hash) ⇒ FileRenderer
constructor
private
Initializes a FileTemplate.
-
#render(filename) ⇒ Object
private
Renders a template file.
Constructor Details
#initialize(hash) ⇒ FileRenderer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initializes a FileTemplate.
19 20 21 |
# File 'lib/wright/util/file_renderer.rb', line 19 def initialize(hash) @hash = hash end |
Instance Method Details
#render(filename) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Renders a template file.
26 27 28 29 30 |
# File 'lib/wright/util/file_renderer.rb', line 26 def render(filename) renderer = renderer_for_file(filename) template = ::File.read(::File.(filename)) renderer.render(template) end |