class ImageParadise::ImageToPdf

Public Class Methods

[](i = '') click to toggle source
#

ImageParadise::ImageToPdf[]

#
# File lib/image_paradise/image_to_pdf/image_to_pdf.rb, line 91
def self.[](i = '')
  new(i)
end
new( commandline_arguments = nil, run_already = true ) click to toggle source
#

initialize

#
# File lib/image_paradise/image_to_pdf/image_to_pdf.rb, line 25
def initialize(
    commandline_arguments = nil,
    run_already           = true
  )
  reset
  set_commandline_arguments(
    commandline_arguments
  )
  run if run_already
end

Public Instance Methods

commandline_arguments?() click to toggle source
#

commandline_arguments?

#
# File lib/image_paradise/image_to_pdf/image_to_pdf.rb, line 69
def commandline_arguments?
  @commandline_arguments
end
extname?() click to toggle source
#

extname?

#
# File lib/image_paradise/image_to_pdf/image_to_pdf.rb, line 76
def extname?
  File.extname(input?)
end
first?()
Alias for: first_argument?
first_argument?() click to toggle source
#

first_argument?

#
# File lib/image_paradise/image_to_pdf/image_to_pdf.rb, line 54
def first_argument?
  @commandline_arguments.first
end
Also aliased as: first?, input?
input?()
Alias for: first_argument?
output?() click to toggle source
#

output?

#
# File lib/image_paradise/image_to_pdf/image_to_pdf.rb, line 62
def output?
  input?.gsub(/#{extname?}/,'')+'.pdf'
end
reset() click to toggle source
#

reset (reset tag)

#
Calls superclass method ImageParadise::Base#reset
# File lib/image_paradise/image_to_pdf/image_to_pdf.rb, line 39
def reset
  super()
end
run() click to toggle source
#

run (run tag)

#
# File lib/image_paradise/image_to_pdf/image_to_pdf.rb, line 83
def run
  _ = "convert #{input?} #{output?}"
  esystem _
end
set_commandline_arguments(i = '') click to toggle source
#

set_commandline_arguments

#
# File lib/image_paradise/image_to_pdf/image_to_pdf.rb, line 46
def set_commandline_arguments(i = '')
  i = [i].flatten.compact
  @commandline_arguments = i
end