lib/hypernova/blank_renderer.rb in hypernova-1.0.3 vs lib/hypernova/blank_renderer.rb in hypernova-1.1.0
- old
+ new
@@ -5,12 +5,12 @@
@job = job
end
def render
<<-HTML
- <div data-hypernova-key="#{key}"></div>
- <script type="application/json" data-hypernova-key="#{key}"><!--#{encode}--></script>
+ <div data-hypernova-key="#{key}" data-hypernova-id="#{id}"></div>
+ <script type="application/json" data-hypernova-key="#{key}" data-hypernova-id="#{id}"><!--#{encode}--></script>
HTML
end
private
@@ -28,7 +28,11 @@
name.gsub(/\W/, "")
end
def name
job[:name]
+ end
+
+ def id
+ @id ||= SecureRandom.uuid
end
end