Class: Docs::ERBRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/docs/erb_renderer.rb

Instance Method Summary collapse

Constructor Details

#initialize(erb_environment) ⇒ ERBRenderer

Returns a new instance of ERBRenderer.


6
7
8
# File 'lib/docs/erb_renderer.rb', line 6

def initialize(erb_environment)
  @erb_environment = erb_environment
end

Instance Method Details

#render(str) ⇒ Object


10
11
12
# File 'lib/docs/erb_renderer.rb', line 10

def render(str)
  ERB.new(str).result(@erb_environment.get_binding)
end