Class: HtmlRenderer

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

Defined Under Namespace

Classes: Model

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ HtmlRenderer

Returns a new instance of HtmlRenderer.



5
6
7
# File 'lib/html_renderer.rb', line 5

def initialize(config)
  @template = config.template_erb 
end

Instance Method Details

#render(issues) ⇒ Object



9
10
11
12
13
# File 'lib/html_renderer.rb', line 9

def render(issues)
  rhtml = ERB.new(IO.read(@template))
  model = Model.new(issues)
  rhtml.result(model.get_binding)
end