Class: Bidi2pdf::Bidi::Commands::BrowsingContextPrint
- Inherits:
-
Object
- Object
- Bidi2pdf::Bidi::Commands::BrowsingContextPrint
- Includes:
- Base
- Defined in:
- lib/bidi2pdf/bidi/commands/browsing_context_print.rb
Instance Method Summary collapse
-
#initialize(context:, print_options:) ⇒ BrowsingContextPrint
constructor
A new instance of BrowsingContextPrint.
- #method_name ⇒ Object
- #params ⇒ Object
Methods included from Base
#==, #as_payload, #eql?, #hash, #inspect
Constructor Details
#initialize(context:, print_options:) ⇒ BrowsingContextPrint
Returns a new instance of BrowsingContextPrint.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/bidi2pdf/bidi/commands/browsing_context_print.rb', line 11 def initialize(context:, print_options:) @context = context @print_options = || { background: true } PrintParametersValidator.validate!(@print_options) return unless @print_options[:page]&.key?(:format) @print_options[:page] = Bidi2pdf.translate_paper_format @print_options[:page][:format] end |
Instance Method Details
#method_name ⇒ Object
26 27 28 |
# File 'lib/bidi2pdf/bidi/commands/browsing_context_print.rb', line 26 def method_name "browsingContext.print" end |
#params ⇒ Object
22 23 24 |
# File 'lib/bidi2pdf/bidi/commands/browsing_context_print.rb', line 22 def params @print_options.merge(context: @context) end |