Class: Gotenberg::PdfEngines

Inherits:
Object
  • Object
show all
Includes:
Headers, Metadata, Files, Properties
Defined in:
lib/gotenberg/pdf_engines.rb,
lib/gotenberg/pdf_engines/files.rb,
lib/gotenberg/pdf_engines/properties.rb

Defined Under Namespace

Modules: Files, Properties

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Properties

#pdf_format

Methods included from Files

#convert, #merge

Methods included from Headers

#trace, #webhook, #webhook_error_method, #webhook_extra_http_headers, #webhook_method

Methods included from Metadata

#meta

Constructor Details

#initialize(args) {|_self| ... } ⇒ PdfEngines

Returns a new instance of PdfEngines.

Yields:

  • (_self)

Yield Parameters:



20
21
22
23
24
25
26
# File 'lib/gotenberg/pdf_engines.rb', line 20

def initialize args
  args.each do |key, value|
    public_send(('%s=' % key), value)
  end

  yield self if block_given?
end

Instance Attribute Details

#base_pathObject

Returns the value of attribute base_path.



13
14
15
# File 'lib/gotenberg/pdf_engines.rb', line 13

def base_path
  @base_path
end

#endpointObject (readonly)

Returns the value of attribute endpoint.



14
15
16
# File 'lib/gotenberg/pdf_engines.rb', line 14

def endpoint
  @endpoint
end

#exceptionObject (readonly)

Returns the value of attribute exception.



14
15
16
# File 'lib/gotenberg/pdf_engines.rb', line 14

def exception
  @exception
end

#responseObject (readonly)

Returns the value of attribute response.



14
15
16
# File 'lib/gotenberg/pdf_engines.rb', line 14

def response
  @response
end

Class Method Details

.call(base_path, &block) ⇒ Object



16
17
18
# File 'lib/gotenberg/pdf_engines.rb', line 16

def self.call(base_path, &block)
  new(base_path: base_path, &block).call
end

Instance Method Details

#callObject



28
29
30
31
32
33
# File 'lib/gotenberg/pdf_engines.rb', line 28

def call
  transform
   if modify_metadata?

  self
end

#success?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/gotenberg/pdf_engines.rb', line 35

def success?
  exception == nil
end

#to_binaryObject



39
40
41
# File 'lib/gotenberg/pdf_engines.rb', line 39

def to_binary
  response || raise(exception)
end