Class: HTMLRender::RenderBatches::HTTPRenderBatch

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(servers) ⇒ HTTPRenderBatch

servers: Hash of (String) key to (String) URL to pass to

HTTPRenderer


10
11
12
# File 'lib/html_render/render_batches.rb', line 10

def initialize(servers)
  @servers = servers
end

Instance Attribute Details

#serversObject (readonly)

Returns the value of attribute servers.



6
7
8
# File 'lib/html_render/render_batches.rb', line 6

def servers
  @servers
end

Instance Method Details

#render_html_to_directory(html, directory) ⇒ Object

html: HTML to render directory: Directory in which to dump PNG files (one per server)



16
17
18
19
# File 'lib/html_render/render_batches.rb', line 16

def render_html_to_directory(html, directory)
  threads = create_threads(html, directory)
  threads.each { |t| t.join }
end