Class: RenderSync::Renderer

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRenderer

Returns a new instance of Renderer.



6
7
8
9
10
11
12
13
# File 'lib/render_sync/renderer.rb', line 6

def initialize
  self.context = ApplicationController.new.view_context
  self.context.instance_eval do
    def url_options
      ActionMailer::Base.default_url_options
    end
  end
end

Instance Attribute Details

#contextObject

Returns the value of attribute context.



4
5
6
# File 'lib/render_sync/renderer.rb', line 4

def context
  @context
end

Instance Method Details

#render_to_string(options) ⇒ Object



15
16
17
# File 'lib/render_sync/renderer.rb', line 15

def render_to_string(options)
  context.render(options)
end