Class: Complate::Renderer
- Inherits:
-
Object
- Object
- Complate::Renderer
- Defined in:
- lib/complate/renderer.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Instance Method Summary collapse
-
#initialize(*context_files) ⇒ Renderer
constructor
A new instance of Renderer.
- #logger=(logger) ⇒ Object
- #render(view, params = {}) ⇒ Object
Constructor Details
#initialize(*context_files) ⇒ Renderer
Returns a new instance of Renderer.
9 10 11 12 13 14 |
# File 'lib/complate/renderer.rb', line 9 def initialize(*context_files) @context = V8::Context.new context_files.each do |file| @context.load(file) end end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
7 8 9 |
# File 'lib/complate/renderer.rb', line 7 def context @context end |
Instance Method Details
#logger=(logger) ⇒ Object
24 25 26 |
# File 'lib/complate/renderer.rb', line 24 def logger=(logger) @context['console'] = LoggerWrapper.new(logger) end |