lib/hypernova/batch_renderer.rb in hypernova-1.0.1 vs lib/hypernova/batch_renderer.rb in hypernova-1.0.2

- old
+ new

@@ -1,8 +1,11 @@ require "hypernova/blank_renderer" +require "hypernova/plugin_helper" class Hypernova::BatchRenderer + include Hypernova::PluginHelper + def initialize(jobs) @jobs = jobs end # Sample response argument: @@ -32,13 +35,14 @@ # { # "DeathStarLaserComponent.js" => "<h1>Hello World</h1>", # "IonCannon.js" => <p>Feel my power!</p>, # } def render(response) - response.each_with_object({}) do |array, hash| + fmt_response = response.each_with_object({}) do |array, hash| name_of_component = array[0] hash[name_of_component] = extract_html_from_result(name_of_component, array[1]) end + after_response(fmt_response, response) end # Example of what is returned by this method: # { # "DeathStarLaserComponent.js" => <div>I am blank</div>,