Class: WkhtmltopdfRunner::Path

Inherits:
Object
  • Object
show all
Defined in:
lib/wkhtmltopdf_runner/path.rb

Constant Summary collapse

EXE_NAME =
'wkhtmltopdf'

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path = nil) ⇒ Path

Returns a new instance of Path.



11
12
13
# File 'lib/wkhtmltopdf_runner/path.rb', line 11

def initialize(path = nil)
  @path = path
end

Class Method Details

.get(path = nil) ⇒ Object



5
6
7
# File 'lib/wkhtmltopdf_runner/path.rb', line 5

def self.get(path = nil)
  new(path).call
end

Instance Method Details

#callObject



15
16
17
18
19
# File 'lib/wkhtmltopdf_runner/path.rb', line 15

def call
  return @path if WkhtmltopdfRunner::Utils.present?(@path)

  find_wkhtmltopdf_binary_path
end