Class: Bidi2pdf::SessionRunner
- Inherits:
-
Object
- Object
- Bidi2pdf::SessionRunner
- Defined in:
- lib/bidi2pdf/session_runner.rb
Overview
Represents a runner for managing browser sessions and executing tasks using the Bidi2pdf library. This class handles the setup, configuration, and execution of browser-related workflows, including navigation, cookie management, and printing.
Instance Method Summary collapse
-
#initialize(session:, url:, inputfile:, output:, cookies: {}, headers: {}, auth: {}, wait_window_loaded: false, wait_network_idle: false, print_options: {}, network_log_format: :console) ⇒ SessionRunner
constructor
rubocop: disable Metrics/ParameterLists.
-
#run ⇒ Object
rubocop: enable Metrics/ParameterLists.
Constructor Details
#initialize(session:, url:, inputfile:, output:, cookies: {}, headers: {}, auth: {}, wait_window_loaded: false, wait_network_idle: false, print_options: {}, network_log_format: :console) ⇒ SessionRunner
rubocop: disable Metrics/ParameterLists
38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/bidi2pdf/session_runner.rb', line 38 def initialize(session:, url:, inputfile:, output:, cookies: {}, headers: {}, auth: {}, wait_window_loaded: false, wait_network_idle: false, print_options: {}, network_log_format: :console) @session = session @url = url @inputfile = inputfile @output = output = || {} @headers = headers || {} @auth = auth || {} @wait_window_loaded = wait_window_loaded @wait_network_idle = wait_network_idle = || {} @network_log_format = network_log_format end |
Instance Method Details
#run ⇒ Object
rubocop: enable Metrics/ParameterLists
55 56 57 58 59 60 61 |
# File 'lib/bidi2pdf/session_runner.rb', line 55 def run @session.start @session.client.on_close { Bidi2pdf.logger.info "WebSocket closed" } setup_browser run_flow end |