Class: Gotenberg::Libreoffice

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

Defined Under Namespace

Modules: Properties, Tools

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Properties

#landscape, #merge, #native_page_ranges, #native_pdf_format, #pdf_format

Methods included from Headers

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

Methods included from Metadata

#meta

Methods included from Tools

#convert

Constructor Details

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

Returns a new instance of Libreoffice.

Yields:

  • (_self)

Yield Parameters:



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

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.



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

def base_path
  @base_path
end

#endpointObject (readonly)

Returns the value of attribute endpoint.



15
16
17
# File 'lib/gotenberg/libreoffice.rb', line 15

def endpoint
  @endpoint
end

#exceptionObject (readonly)

Returns the value of attribute exception.



15
16
17
# File 'lib/gotenberg/libreoffice.rb', line 15

def exception
  @exception
end

#responseObject (readonly)

Returns the value of attribute response.



15
16
17
# File 'lib/gotenberg/libreoffice.rb', line 15

def response
  @response
end

Class Method Details

.call(base_path, &block) ⇒ Object



17
18
19
# File 'lib/gotenberg/libreoffice.rb', line 17

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

Instance Method Details

#callObject



29
30
31
32
33
34
# File 'lib/gotenberg/libreoffice.rb', line 29

def call
  transform
   if modify_metadata?

  self
end

#success?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/gotenberg/libreoffice.rb', line 36

def success?
  exception == nil
end

#to_binaryObject



40
41
42
# File 'lib/gotenberg/libreoffice.rb', line 40

def to_binary
  response || raise(exception)
end